From 3879a6f300a26d67f34a8933fd8dae6ed9d08a4d Mon Sep 17 00:00:00 2001 From: Elhamne Date: Wed, 8 Feb 2023 21:38:34 +0330 Subject: [PATCH] Fixed handle prev role, #13 --- src/components/searchResult/InfoTabs.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/searchResult/InfoTabs.jsx b/src/components/searchResult/InfoTabs.jsx index 298ab07e..94a2505b 100644 --- a/src/components/searchResult/InfoTabs.jsx +++ b/src/components/searchResult/InfoTabs.jsx @@ -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); @@ -280,7 +284,7 @@ export default function InfoTabs({ /> )} {/* Back to Previous Role warn popup */} - {previousRole && ( + {previousRole !== null && (