Skip to content

Commit

Permalink
maintain selected card value if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
van-go authored Oct 27, 2023
1 parent bc71040 commit 6f70f11
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,16 @@ const AllocationsTeamViewModal = ({ isOpen, toggle }) => {
const [selectedTab, setSelectedTab] = useState(0);
const handleTabChange = (e, newValue) => {
setSelectedTab(newValue);
if (selectedTab === 0){
setCard(null)
}
};

let selectedUser = useState(null);
if (removingUserOperation) {
selectedUser = removingUserOperation.username;
}
if (card && card.username === selectedUser) {
setCard(null);
}

return (
<Modal isOpen={isOpen} toggle={toggle} size="lg" onClosed={resetCard}>
<ModalHeader className="has-MuiTabs" toggle={toggle} charCode="&#xe912;">
Expand Down

0 comments on commit 6f70f11

Please sign in to comment.