From ab4321ad339f36e0e69963a9f8bb97e7a431e0e6 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 20 Dec 2022 14:44:19 +0000 Subject: [PATCH] refactor: simplify assignment --- composables/users.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composables/users.ts b/composables/users.ts index 1118d211..89c015ea 100644 --- a/composables/users.ts +++ b/composables/users.ts @@ -19,9 +19,8 @@ const instances = useLocalStorage>(STORAGE_KEY_SERVERS, const currentUserId = useLocalStorage(STORAGE_KEY_CURRENT_USER, mock ? mock.user.account.id : '') export const currentUser = computed(() => { - let user: UserLogin | undefined 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) return user }