diff --git a/src/App.vue b/src/App.vue index 7c3d46e..b0a0ca5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,13 +9,13 @@ import { useStore } from './stores/store' import LandingPage from './pages/LandingPage.vue' import { useInterval } from './composables/useInterval' import { AppStorage } from './storage' -import { Page, useRoute } from './stores/route' import ContextMenu from './components/ContextMenu.vue' import { useContextmenu } from './stores/contextmenu' import { useTheme } from './composables/useTheme' +import { Page, useRoute } from './composables/useRoute' const store = useStore() -const route = useRoute() +const { currentPage } = useRoute() const contextmenu = useContextmenu() useInterval(() => { @@ -41,9 +41,9 @@ watchEffect(() => { - - - + + + >(null) @@ -18,11 +18,11 @@ const focus = batchFn(() => { scrollView.value?.getElement()?.focus() }) -watch(() => route.currentPage, focus, { flush: 'post' }) useTauriEvent('window:hidden', focus) onMounted(focus) +watch(route.currentPage, () => { + focus() -watch(() => route.currentPage, () => { const element = scrollView.value?.osInstance()?.elements().scrollOffsetElement if (element) element.scrollTop = 0 diff --git a/src/components/AppSidebar.vue b/src/components/AppSidebar.vue index f215646..ae4634a 100644 --- a/src/components/AppSidebar.vue +++ b/src/components/AppSidebar.vue @@ -6,8 +6,8 @@ import { REPO_LINK } from '../constants' import { useStore } from '../stores/store' import { AppStorage } from '../storage' import { useKey } from '../composables/useKey' -import { Page, useRoute } from '../stores/route' import { useI18n } from '../composables/useI18n' +import { Page, useRoute } from '../composables/useRoute' import { Icons } from './Icons' import SidebarButton from './SidebarButton.vue' import Popover from './Popover.vue' @@ -49,7 +49,7 @@ const moreItems = computed(() => [ useKey('r', () => { store.fetchNotifications(true) -}, { source: () => route.currentPage === Page.Home }) +}, { source: () => route.currentPage.value === Page.Home })