From ed3dd7c69b1097e141a8f659c1917a512732fe32 Mon Sep 17 00:00:00 2001 From: Arnab Chakraborty <11457760+Rocky43007@users.noreply.github.com> Date: Thu, 8 Aug 2024 01:46:27 +0300 Subject: [PATCH] Proper state change for showing logged out page --- interface/app/$libraryId/settings/client/account/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/app/$libraryId/settings/client/account/index.tsx b/interface/app/$libraryId/settings/client/account/index.tsx index a7a6ea53c..73e5ac4f9 100644 --- a/interface/app/$libraryId/settings/client/account/index.tsx +++ b/interface/app/$libraryId/settings/client/account/index.tsx @@ -29,14 +29,16 @@ export const Component = () => { return data; } _().then((data) => { - if (data.message !== 'unauthorised') { - setUserInfo(data as User); + // Check if data is the same as the user type + if (data.id) { + setUserInfo(data); } else { setUserInfo(null); } }); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + console.log('[DEBUG] userInfo', userInfo); return ( <>