Skip to content

Commit

Permalink
fix: undefined conditions of user profile
Browse files Browse the repository at this point in the history
Signed-off-by: bhavanakarwade <[email protected]>
  • Loading branch information
bhavanakarwade committed Dec 4, 2024
1 parent 191696c commit 1a14d3b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/Authentication/SignInUserPasskey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ const SignInUserPasskey = (signInUserProps: signInUserProps) => {

}
await setToLocalStorage(storageKeys.PERMISSIONS, permissionArray);
await setToLocalStorage(storageKeys.USER_PROFILE, userProfile);
// await setToLocalStorage(storageKeys.USER_PROFILE, userProfile);
await setToLocalStorage(storageKeys.USER_PROFILE, JSON.stringify(userProfile));
await setToLocalStorage(storageKeys.USER_EMAIL, data?.data?.email);
return {
role: role?.orgRole || ""
Expand Down
3 changes: 2 additions & 1 deletion src/components/Authentication/SignInUserPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const SignInUserPassword = (signInUserProps: SignInUser3Props) => {
id, profileImg, firstName, email,

}
await setToLocalStorage(storageKeys.USER_PROFILE, userProfile);
// await setToLocalStorage(storageKeys.USER_PROFILE, userProfile);
await setToLocalStorage(storageKeys.USER_PROFILE, JSON.stringify(userProfile));
await setToLocalStorage(storageKeys.USER_EMAIL, data?.data?.email);
return {
role: role?.orgRole ?? '',
Expand Down
3 changes: 2 additions & 1 deletion src/components/Profile/EditUserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ const EditUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile }:
}

updateProfile(userData);
await setToLocalStorage(storageKeys.USER_PROFILE, updatedUserData);
// await setToLocalStorage(storageKeys.USER_PROFILE, updatedUserData);
await setToLocalStorage(storageKeys.USER_PROFILE, JSON.stringify(updatedUserData));
window.location.reload();
setLoading(false)
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Profile/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const UserProfile = ({ noBreadcrumb }: { noBreadcrumb?: boolean }) => {
const userProfile = {
id, profileImg, firstName, email,
}
await setToLocalStorage(storageKeys.USER_PROFILE, userProfile)
// await setToLocalStorage(storageKeys.USER_PROFILE, userProfile)
await setToLocalStorage(storageKeys.USER_PROFILE, JSON.stringify(userProfile))
await setToLocalStorage(storageKeys.USER_EMAIL, data?.data?.email)
}
} catch (error) {
Expand Down

0 comments on commit 1a14d3b

Please sign in to comment.