fix: handle undefined ._ property on useUserLocalStorage (#1060)

Fixes https://github.com/elk-zone/elk/issues/1056
This commit is contained in:
Tom Sherman 2023-01-13 10:31:16 +00:00 committed by GitHub
parent b51fa37b34
commit 0b120e8b42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,7 +292,7 @@ export function clearUserLocalStorage(account?: mastodon.v1.Account) {
const id = `${account.acct}@${currentInstance.value?.uri || currentServer.value}`
// @ts-expect-error bind value to the function
;(useUserLocalStorage._ as Map<string, Ref<Record<string, any>>>).forEach((storage) => {
;(useUserLocalStorage._ as Map<string, Ref<Record<string, any>>> | undefined)?.forEach((storage) => {
if (storage.value[id])
delete storage.value[id]
})