fix(electron): should not send switchSplitView event when clicking on the active view (#7944)

This commit is contained in:
pengx17
2024-08-22 05:26:29 +00:00
parent 592150638e
commit 2f02f0da2b

View File

@@ -133,6 +133,9 @@ const WorkbenchTab = ({
); );
const onActivateView = useAsyncCallback( const onActivateView = useAsyncCallback(
async (viewIdx: number) => { async (viewIdx: number) => {
if (viewIdx === activeViewIndex && tabActive) {
return;
}
await tabsHeaderService.activateView?.(workbench.id, viewIdx); await tabsHeaderService.activateView?.(workbench.id, viewIdx);
if (tabActive) { if (tabActive) {
track.$.appTabsHeader.$.tabAction({ track.$.appTabsHeader.$.tabAction({
@@ -146,7 +149,7 @@ const WorkbenchTab = ({
}); });
} }
}, },
[tabActive, tabsHeaderService, workbench.id] [activeViewIndex, tabActive, tabsHeaderService, workbench.id]
); );
const handleAuxClick: MouseEventHandler = useCatchEventCallback( const handleAuxClick: MouseEventHandler = useCatchEventCallback(
async e => { async e => {