Skip to content

Commit

Permalink
WP-104: phantom entry in ViewTab when user removed (#884)
Browse files Browse the repository at this point in the history
* wp-104: phantom entry n ViewTab when user removed

* maintain selected card value if it exists

* prettier

* requested changes

* prettier

---------

Co-authored-by: Chandra Y <[email protected]>
  • Loading branch information
van-go and chandra-tacc authored Nov 14, 2023
1 parent 5e6be96 commit 4d006aa
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ const AllocationsTeamViewModal = ({ isOpen, toggle }) => {
const handleTabChange = (e, newValue) => {
setSelectedTab(newValue);
};

let selectedUser = null;
if (removingUserOperation && removingUserOperation.username) {
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 4d006aa

Please sign in to comment.