pref: improve current user handle writting

zio/stable
Anthony Fu 2023-01-14 10:58:46 +01:00
parent 55a58f5509
commit 680b3493b3
1 changed files with 4 additions and 1 deletions

View File

@ -92,7 +92,10 @@ if (process.client) {
}, { immediate: true, flush: 'post' })
// for injected script to read
useLocalStorage<string>(STORAGE_KEY_CURRENT_USER_HANDLE, computed(() => currentUser.value?.account.acct || ''))
const currentUserHandle = computed(() => currentUser.value?.account.acct || '')
watchEffect(() => {
localStorage.setItem(STORAGE_KEY_CURRENT_USER_HANDLE, currentUserHandle.value)
})
}
export const useUsers = () => users