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

Fixes https://github.com/elk-zone/elk/issues/1056
zio/stable
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
1 changed files with 1 additions and 1 deletions

View File

@ -292,7 +292,7 @@ export function clearUserLocalStorage(account?: mastodon.v1.Account) {
const id = `${account.acct}@${currentInstance.value?.uri || currentServer.value}` const id = `${account.acct}@${currentInstance.value?.uri || currentServer.value}`
// @ts-expect-error bind value to the function // @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]) if (storage.value[id])
delete storage.value[id] delete storage.value[id]
}) })