refactor: simplify assignment
This commit is contained in:
parent
11731ee280
commit
ab4321ad33
|
@ -19,9 +19,8 @@ const instances = useLocalStorage<Record<string, Instance>>(STORAGE_KEY_SERVERS,
|
||||||
const currentUserId = useLocalStorage<string>(STORAGE_KEY_CURRENT_USER, mock ? mock.user.account.id : '')
|
const currentUserId = useLocalStorage<string>(STORAGE_KEY_CURRENT_USER, mock ? mock.user.account.id : '')
|
||||||
|
|
||||||
export const currentUser = computed<UserLogin | undefined>(() => {
|
export const currentUser = computed<UserLogin | undefined>(() => {
|
||||||
let user: UserLogin | undefined
|
|
||||||
if (currentUserId.value) {
|
if (currentUserId.value) {
|
||||||
user = users.value.find(user => user.account?.id === currentUserId.value)
|
const user = users.value.find(user => user.account?.id === currentUserId.value)
|
||||||
if (user)
|
if (user)
|
||||||
return user
|
return user
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue