Fix router navigation

environments/review-front-deve-otr6gc/deployments/13419
wvffle 2022-06-30 03:20:34 +00:00 zatwierdzone przez Georg Krause
rodzic a28e00708b
commit 33dfeea168
2 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -14,7 +14,7 @@ export default (orderingConfigName: MaybeRef<RouteWithPreferences | null>) => {
const config = reactiveComputed(() => {
const name = unref(orderingConfigName) ?? route.name as RouteWithPreferences
return store.state.ui.routePreferences[name]
return { ...store.state.ui.routePreferences[name] }
})
const { paginateBy, ordering, orderingDirection } = toRefs(config)
@ -29,7 +29,10 @@ export default (orderingConfigName: MaybeRef<RouteWithPreferences | null>) => {
field: (str[0] === '-' || str[0] === '+' ? str.slice(1) : str) as OrderingField
})
const onOrderingUpdate = (fn: () => void) => watch(config, fn)
const onOrderingUpdate = (fn: () => void) => {
const stop = watch(config, fn)
return stop
}
return {
paginateBy,

Wyświetl plik

@ -673,9 +673,7 @@ export default createRouter({
path: 'podcasts/',
name: 'library.podcasts.browse',
component: () =>
import(
'~/components/library/Podcasts.vue'
),
import('~/components/library/Podcasts.vue'),
props: route => ({
defaultOrdering: route.query.ordering,
defaultQuery: route.query.query,