From 293c680b1c6516806b115d82dfa1230e0e36fb63 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Wed, 6 Dec 2023 00:53:47 +0900 Subject: [PATCH] refs #4653 Save the last timeline and go to there when opened --- renderer/pages/accounts/[id]/[timeline].tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renderer/pages/accounts/[id]/[timeline].tsx b/renderer/pages/accounts/[id]/[timeline].tsx index 1feb25cd..ce8a7478 100644 --- a/renderer/pages/accounts/[id]/[timeline].tsx +++ b/renderer/pages/accounts/[id]/[timeline].tsx @@ -27,6 +27,12 @@ export default function Page() { } }, [router.query.id]) + useEffect(() => { + if (router.query.timeline && router.query.id && typeof localStorage !== 'undefined') { + localStorage.setItem(`${router.query.id}_lastTimeline`, router.query.timeline as string) + } + }, [router.query.id, router.query.timeline]) + if (!account || !client) return null switch (router.query.timeline as string) { case 'notifications': {