Skip to content

Commit

Permalink
fix when disable dev mode , current tab is obsolete
Browse files Browse the repository at this point in the history
Signed-off-by: maissa SOUISSI <[email protected]>
  • Loading branch information
souissimai committed Jul 15, 2024
1 parent 779b4c9 commit 89341f9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/result-view-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,17 @@ export const ResultViewTab: FunctionComponent<IResultViewTabProps> = ({
previousEnableDeveloperMode !== enableDeveloperMode
) {
// a displayed tab may be obsolete when developer mode is disabled, then switch on first one
setTabIndex(0);
if (lastCompletedComputation === ComputingType.SECURITY_ANALYSIS) {
setTabIndex(1);
} else {
setTabIndex(0);
}
}
}, [enableDeveloperMode, previousEnableDeveloperMode]);
}, [
enableDeveloperMode,
previousEnableDeveloperMode,
lastCompletedComputation,
]);

const handleChangeTab = useCallback(
(event: React.SyntheticEvent, newTabIndex: number) => {
Expand Down

0 comments on commit 89341f9

Please sign in to comment.