From 0ff19b731764aab1ba7fef216ccb049ba5e716f7 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 9 Jan 2024 06:18:11 +0000 Subject: [PATCH] fix: avoid overriding extra user props --- packages/nc-gui/composables/useGlobal/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/nc-gui/composables/useGlobal/index.ts b/packages/nc-gui/composables/useGlobal/index.ts index 1e538b016d..12259b4419 100644 --- a/packages/nc-gui/composables/useGlobal/index.ts +++ b/packages/nc-gui/composables/useGlobal/index.ts @@ -66,6 +66,8 @@ export const useGlobal = createGlobalState((): UseGlobalReturn => { (nextPayload) => { if (nextPayload) { state.user.value = { + // keep existing props if user id same as before + ...(state.user.value?.id === nextPayload.id ? state.user.value || {} : {}), id: nextPayload.id, email: nextPayload.email, firstname: nextPayload.firstname,