feat: remember last accessed explore tab (#2658)
This commit is contained in:
parent
d579977790
commit
0f583ece28
7 changed files with 46 additions and 10 deletions
|
@ -1,7 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { STORAGE_KEY_HIDE_EXPLORE_NEWS_TIPS } from '~~/constants'
|
||||
import { STORAGE_KEY_HIDE_EXPLORE_NEWS_TIPS, STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE } from '~~/constants'
|
||||
|
||||
const { t } = useI18n()
|
||||
const route = useRoute()
|
||||
|
||||
const paginator = useMastoClient().v1.trends.links.list()
|
||||
|
||||
|
@ -10,6 +11,13 @@ const hideNewsTips = useLocalStorage(STORAGE_KEY_HIDE_EXPLORE_NEWS_TIPS, false)
|
|||
useHydratedHead({
|
||||
title: () => `${t('tab.news')} | ${t('nav.explore')}`,
|
||||
})
|
||||
|
||||
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
|
||||
lastAccessedExploreRoute.value = route.path.replace(/(.*\/explore\/?)/, '')
|
||||
|
||||
onActivated(() => {
|
||||
lastAccessedExploreRoute.value = route.path.replace(/(.*\/explore\/?)/, '')
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue