Skip to content

Commit

Permalink
fix: solved react minified error (#833)
Browse files Browse the repository at this point in the history
Signed-off-by: bhavanakarwade <[email protected]>
  • Loading branch information
bhavanakarwade authored and pranalidhanavade committed Dec 5, 2024
1 parent 5932255 commit 18b79ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/components/Profile/DisplayProfileImg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ const DisplayProfileImg = () => {
const userProfile = await getFromLocalStorage(storageKeys.USER_PROFILE)
const orgRoles = await getFromLocalStorage(storageKeys.ORG_ROLES)
const parsedUser = userProfile ? JSON.parse(userProfile) : null;
parsedUser.roles = orgRoles
setUserObj(parsedUser)

if (parsedUser) {
parsedUser.roles = orgRoles;
setUserObj(parsedUser);
}
}

useEffect(() => {
Expand Down
11 changes: 7 additions & 4 deletions src/components/Profile/DisplayUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ const DisplayUser = () => {
const userProfile = await getFromLocalStorage(storageKeys.USER_PROFILE)
const orgRoles = await getFromLocalStorage(storageKeys.ORG_ROLES)
const parsedUser = userProfile ? JSON.parse(userProfile) : null
parsedUser.roles = orgRoles
setUserObj(parsedUser)

if (parsedUser) {
parsedUser.roles = orgRoles;
setUserObj(parsedUser);
}
}
useEffect(() => {
const fetchData = async () => {
Expand All @@ -39,10 +42,10 @@ const DisplayUser = () => {
className="text-xl font-medium text-gray-900 truncate dark:text-gray-300 mb-1"
role="none"
>
{userObj['firstName']}
{userObj?.['firstName']}
</p>
<p className="text-sm text-gray-900 dark:text-white mb-1" role="none">
{userObj['email']}
{userObj?.['email']}
</p>
<p
className="text-base font-medium text-gray-900 truncate dark:text-gray-300"
Expand Down

0 comments on commit 18b79ef

Please sign in to comment.