diff --git a/components/nav/NavSide.vue b/components/nav/NavSide.vue index bc051519..6b1318dd 100644 --- a/components/nav/NavSide.vue +++ b/components/nav/NavSide.vue @@ -8,6 +8,31 @@ const { notifications } = useNotifications() const useStarFavoriteIcon = usePreferences('useStarFavoriteIcon') const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '') const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '') + +const notificationsLink = computed(() => { + const hydrated = isHydrated.value + const user = currentUser.value + const lastRoute = lastAccessedNotificationRoute.value + if (!hydrated || !user || !lastRoute) { + return '/notifications' + } + + return `/notifications/${lastRoute}` +}) +const exploreLink = computed(() => { + const hydrated = isHydrated.value + const server = currentServer.value + let lastRoute = lastAccessedExploreRoute.value + if (!hydrated) { + return '/explore' + } + + if (lastRoute.length) { + lastRoute = `/${lastRoute}` + } + + return server ? `/${server}/explore${lastRoute}` : `/explore${lastRoute}` +})