Fix TypeError if switching to anon on /settings
This commit is contained in:
parent
31dec0eee6
commit
051ba7397a
|
@ -55,6 +55,13 @@ export default function Settings ({ ssrData }) {
|
|||
const { settings: { privates: settings } } = data || ssrData
|
||||
if (!data && !ssrData) return <PageLoading />
|
||||
|
||||
// if we switched to anon, me is no longer defined
|
||||
const router = useRouter()
|
||||
if (!me) {
|
||||
router.push('/login')
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<CenterLayout>
|
||||
<div className='py-3 w-100'>
|
||||
|
|
Loading…
Reference in New Issue