pref: improve current user handle writting

This commit is contained in:
Anthony Fu 2023-01-14 10:58:46 +01:00
parent 55a58f5509
commit 680b3493b3

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