diff --git a/components/app-navigation-menu.vue b/components/app-navigation-menu.vue index b41d1da..090420e 100644 --- a/components/app-navigation-menu.vue +++ b/components/app-navigation-menu.vue @@ -13,6 +13,9 @@ const emit = defineEmits<{ const { menus } = toRefs(props); +const router = useRouter(); +const route = useRoute(); + const windowsStore = useWindowsStore(); const { setWindowArrangement } = windowsStore; const { arrangement: currentArrangement, registry } = storeToRefs(windowsStore); @@ -79,6 +82,11 @@ onScopeDispose(() => { } item.winbox.focus(); + + /** Windows are only displayed on `/`. */ + if (route.path !== '/') { + void router.push('/'); + } } " > diff --git a/layouts/default.vue b/layouts/default.vue index 7f42608..18f225b 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -97,6 +97,17 @@ useHead({ return scripts; }), }); + +/** + * We only want to display windows on the root route. + * + * We always render the window manager in the layout, to avoid remounting the window root, + * and consequently having to manually mount/unmount every single window. + * of every single window. + */ +const isWindowManagerVisible = computed(() => { + return route.path === "/"; +});