1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-02-10 00:30:39 +01:00

Fix localStorage for build

This commit is contained in:
AkiraFukushima 2023-11-03 01:04:47 +09:00
parent 832697f53a
commit 5518619f05
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957

View File

@ -4,11 +4,13 @@ type AccountProps = {}
export default function Account(props: AccountProps) {
const router = useRouter()
const lastTimeline = localStorage.getItem(`${router.query.id}_lastTimeline`)
if (lastTimeline) {
router.push(`/accounts/${router.query.id}/${lastTimeline}`)
} else {
router.push(`/accounts/${router.query.id}/home`)
if (typeof localStorage !== 'undefined') {
const lastTimeline = localStorage.getItem(`${router.query.id}_lastTimeline`)
if (lastTimeline) {
router.push(`/accounts/${router.query.id}/${lastTimeline}`)
} else {
router.push(`/accounts/${router.query.id}/home`)
}
}
return <>{router.query.id}</>