From 726f34cd548aff860f810efab1161df890ffdaf5 Mon Sep 17 00:00:00 2001 From: omaroughriss Date: Thu, 13 Nov 2025 16:51:24 +0100 Subject: [PATCH] Use username in the dropdown menu --- app/dashboard/layout.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/dashboard/layout.tsx b/app/dashboard/layout.tsx index fba9a3a..9707b2c 100644 --- a/app/dashboard/layout.tsx +++ b/app/dashboard/layout.tsx @@ -79,12 +79,13 @@ function DashboardLayoutContent({ children }: { children: React.ReactNode }) { const userStore = UserStore.getInstance() const accessToken = userStore.getAccessToken() - if (accessToken) { + if (accessToken && userName !== null) { setIsAuthenticated(true) const pairingId = userStore.getUserPairingId() + setUserInfo({ id: pairingId?.slice(0, 8) + "...", - name: "Utilisateur 4NK", + name: userName, email: "user@4nk.io", role: "Utilisateur", company: "Organisation 4NK", @@ -98,7 +99,7 @@ function DashboardLayoutContent({ children }: { children: React.ReactNode }) { } } checkAuthentication() - }, [iframeUrl]) + }, [iframeUrl, userName]) const handle4nkConnect = useCallback(() => { setIsConnected(true);