mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(electron): should not send switchSplitView event when clicking on the active view (#7944)
This commit is contained in:
@@ -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 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user