fix: Fix if vote is undefined

This commit is contained in:
Xyphyn committed 2023-07-13 19:09:55 -07:00
1 parent ff3246c0a6
commit 5f4c32fe2c
4 files changed
+25 -7

No files matched your search

-3
View File
@@ -77,11 +77,8 @@ authData.subscribe(async (data) => {
const site = await getClient().getSite({
auth: data.token,
})
if (!site?.my_user) throw Error('Missing user')
user.set({ ...site.my_user.local_user_view, unreads: 0 })
if (typeof localStorage != 'undefined') {
localStorage.setItem('user', JSON.stringify(data))
}