Stash the current filter so when we pop we can return to it

This commit is contained in:
Jackson Harper 2023-03-07 10:36:39 +08:00
parent 36e7a0378d
commit 6362e00a71
2 changed files with 10 additions and 1 deletions

View file

@ -541,6 +541,7 @@ export function HomeFeedContainer(): JSX.Element {
}
const href = `${window.location.pathname}?${qp.toString()}`
router.push(href, href, { shallow: true })
window.sessionStorage.setItem('q', qp.toString())
performActionOnItem('refresh', undefined as unknown as any)
}}
loadMore={() => {

View file

@ -208,7 +208,15 @@ export default function Home(): JSX.Element {
section: 'Article',
name: 'Return to library',
shortcut: ['u'],
perform: () => router.push(`/home`),
perform: () => {
const query = window.sessionStorage.getItem('q')
if (query) {
router.push(`/home?${query}`)
return
} else {
router.push(`/home`)
}
},
},
{
id: 'archive',