diff --git a/src/composables/useTitle.ts b/src/composables/useTitle.ts index 62d30623a..981e4d59c 100644 --- a/src/composables/useTitle.ts +++ b/src/composables/useTitle.ts @@ -1,12 +1,21 @@ -import { computed, watchEffect } from 'vue' -import type { ComputedGetter } from 'vue' +import { computed } from 'vue' +import type { Ref } from 'vue' -import { setTitle } from '@/helpers/setTitle' +import {useTitle as useTitleVueUse, resolveRef} from '@vueuse/core' -export function useTitle(titleGetter: ComputedGetter) { - const titleRef = computed(titleGetter) +type UseTitleParameters = Parameters - watchEffect(() => setTitle(titleRef.value)) +export function useTitle(...args: UseTitleParameters) { - return titleRef + const [newTitle, ...restArgs] = args + + const pageTitle = resolveRef(newTitle) as Ref + + const completeTitle = computed(() => + (typeof pageTitle.value === 'undefined' || pageTitle.value === '') + ? 'Vikunja' + : `${pageTitle.value} | Vikunja`, + ) + + return useTitleVueUse(completeTitle, ...restArgs) } \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 2b3e63043..b69ea3662 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -238,6 +238,7 @@ const router = createRouter({ meta: { showAsModal: true, }, + props: route => ({ namespaceId: parseInt(route.params.id as string) }), }, { path: '/namespaces/:id/settings/delete', diff --git a/src/views/namespaces/settings/archive.vue b/src/views/namespaces/settings/archive.vue index 7903ef612..950c1c126 100644 --- a/src/views/namespaces/settings/archive.vue +++ b/src/views/namespaces/settings/archive.vue @@ -7,50 +7,79 @@ + +