mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-29 05:48:49 +03:00
fix: sync current account across tabs 2 (#816)
This commit is contained in:
parent
d8eec1ed5e
commit
573bf48eda
1 changed files with 0 additions and 4 deletions
|
@ -68,10 +68,6 @@ if (process.client) {
|
||||||
watch(currentUserId, async (id, oldId) => {
|
watch(currentUserId, async (id, oldId) => {
|
||||||
// when sign in or switch account
|
// when sign in or switch account
|
||||||
if (id) {
|
if (id) {
|
||||||
// initial load
|
|
||||||
if (!oldId)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (id === currentUser.value?.account?.id) {
|
if (id === currentUser.value?.account?.id) {
|
||||||
// when sign in, the other tab will not have the user, idb is not reactive
|
// when sign in, the other tab will not have the user, idb is not reactive
|
||||||
const newUser = users.value.find(user => user.account?.id === id)
|
const newUser = users.value.find(user => user.account?.id === id)
|
||||||
|
|
Loading…
Reference in a new issue