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:
parent
832697f53a
commit
5518619f05
@ -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}</>
|
||||
|
Loading…
x
Reference in New Issue
Block a user