fix: handle account switching when accounts have the same id (#1510)

This commit is contained in:
Stanislas 2023-01-29 16:58:32 +01:00 committed by GitHub
parent fa44fae991
commit 72bf6fb6f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 24 deletions

View file

@ -5,7 +5,7 @@ const all = useUsers()
const router = useRouter()
const clickUser = (user: UserLogin) => {
if (user.account.id === currentUser.value?.account.id)
if (user.account.acct === currentUser.value?.account.acct)
router.push(getAccountRoute(user.account))
else
switchUser(user)
@ -21,7 +21,7 @@ const clickUser = (user: UserLogin) => {
flex rounded
cursor-pointer
aria-label="Switch user"
:class="user.account.id === currentUser?.account.id ? '' : 'op25 grayscale'"
:class="user.account.acct === currentUser?.account.acct ? '' : 'op25 grayscale'"
hover="filter-none op100"
@click="clickUser(user)"
>