Skip to content

Commit

Permalink
Fixed handle prev role, #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Elhamne committed Feb 8, 2023
1 parent 4454d28 commit 3879a6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/searchResult/InfoTabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ export default function InfoTabs({
const handlePreviousRole = (memberRole) => {
setPreviousRole(memberRole);
// For invitation. The search case handled in handleSelectRole.
if (userRole !== null && userRole !== previousRole) {
if (
userRole !== null &&
previousRole !== null &&
userRole !== previousRole
) {
localStorage.removeItem('invitationToken');
setInviteeRole(null);
setIsInvite(false);
Expand Down Expand Up @@ -280,7 +284,7 @@ export default function InfoTabs({
/>
)}
{/* Back to Previous Role warn popup */}
{previousRole && (
{previousRole !== null && (
<PrevRoleModal
backToPrevRole={backToPrevRole}
setBackToPrevRole={setBackToPrevRole}
Expand Down

0 comments on commit 3879a6f

Please sign in to comment.