Skip to content

Commit

Permalink
Fix for quickly switching between tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgasper committed Dec 12, 2023
1 parent 04b7193 commit 27d2d40
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/shared/components/challenge-listing/ChallengeTab/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ const ChallengeTab = ({
if (currentTabName === TAB_NAME.ACTIVE_CHALLENGES) {
return;
}
setPreviousBucketOfPastChallengesTab(activeBucket);
if (past) {
setPreviousBucketOfPastChallengesTab(activeBucket);
}
setCurrentSelected(0);
setIsTabClosed(true);
let selectedBucket = '';
Expand All @@ -90,6 +92,11 @@ const ChallengeTab = ({
if (currentTabName === TAB_NAME.INNOVATION_CHALLENGE) {
return;
}
if (!past) {
setPreviousBucketOfActiveTab(activeBucket);
} else {
setPreviousBucketOfPastChallengesTab(activeBucket);
}
setFilterState({
..._.cloneDeep(filterState),
isInnovationChallenge: 'true',
Expand All @@ -102,7 +109,9 @@ const ChallengeTab = ({
if (currentTabName === TAB_NAME.PAST_CHALLENGES) {
return;
}
setPreviousBucketOfActiveTab(activeBucket);
if (!past) {
setPreviousBucketOfActiveTab(activeBucket);
}
setCurrentSelected(1);
setIsTabClosed(true);
let selectedBucket = '';
Expand Down

0 comments on commit 27d2d40

Please sign in to comment.