diff --git a/front/src/components/ui/Tabs.vue b/front/src/components/ui/Tabs.vue index 53673a020..9ee7af29b 100644 --- a/front/src/components/ui/Tabs.vue +++ b/front/src/components/ui/Tabs.vue @@ -6,17 +6,23 @@ import { type Props as TabProps } from '~/components/ui/Tab.vue' import Button from "~/components/ui/Button.vue"; import Link from "~/components/ui/Link.vue"; +import { useRoute } from 'vue-router' const currentTitle = ref('') const tabs = reactive([]) +const currentRoute = useRoute() provide(TABS_INJECTION_KEY, { currentTitle: currentTitle, tabs: tabs, }) +const actualCurrentTitle = computed(() => + tabs.find(({ to })=>currentRoute.matched.some(route => typeof to === 'string' ? route.path === to : to && 'path' in to && route.path === to.path))?.title + || currentTitle.value) + const currentIndex = computed(() => - tabs.findIndex(({title}) => title === currentTitle.value) + tabs.findIndex(({title}) => title === actualCurrentTitle.value) ) watch(() => tabs.length, (_, from) => { diff --git a/front/src/ui/components/Sidebar.vue b/front/src/ui/components/Sidebar.vue index a97ea06a8..e929e3eff 100644 --- a/front/src/ui/components/Sidebar.vue +++ b/front/src/ui/components/Sidebar.vue @@ -55,14 +55,13 @@ const logoUrl = computed(() => store.state.auth.authenticated ? 'library.index' ghost /> - + diff --git a/front/src/ui/composables/useModal.ts b/front/src/ui/composables/useModal.ts index c6107a4c6..359459bfc 100644 --- a/front/src/ui/composables/useModal.ts +++ b/front/src/ui/composables/useModal.ts @@ -49,8 +49,7 @@ export const useModal = ( return flag in query.value && assignment.isOn(query.value[flag]); }, set(newValue: boolean) { - router - .push({ + router.push({ query: { ...query.value, [flag]: newValue ? assignment.on(null) : undefined, @@ -75,8 +74,7 @@ export const useModal = ( return typeof flagValue === 'string' ? flagValue : flagValue === null ? '' : flagValue.join(' '); }, set(newValue: string) { - router - .push({ + router.push({ query: { ...query.value, [flag]: newValue, diff --git a/front/src/ui/modals/Upload.vue b/front/src/ui/modals/Upload.vue index 08cce88fe..8058412bc 100644 --- a/front/src/ui/modals/Upload.vue +++ b/front/src/ui/modals/Upload.vue @@ -1,7 +1,6 @@