fix(electron): app menu about action (#10445)

fix AF-2268
This commit is contained in:
pengx17
2025-03-03 03:00:17 +00:00
parent bd1b26a230
commit 629aea48df
2 changed files with 15 additions and 9 deletions

View File

@@ -142,12 +142,6 @@ window.addEventListener('unload', () => {
.catch(console.error);
});
events?.applicationMenu.openAboutPageInSettingModal(() =>
frameworkProvider.get(WorkspaceDialogService).open('setting', {
activeTab: 'about',
})
);
function getCurrentWorkspace() {
const currentWorkspaceId = frameworkProvider
.get(GlobalContextService)
@@ -167,6 +161,18 @@ function getCurrentWorkspace() {
};
}
events?.applicationMenu.openAboutPageInSettingModal(() => {
const currentWorkspace = getCurrentWorkspace();
if (!currentWorkspace) {
return;
}
const { workspace, dispose } = currentWorkspace;
workspace.scope.get(WorkspaceDialogService).open('setting', {
activeTab: 'about',
});
dispose();
});
events?.applicationMenu.onNewPageAction(type => {
const currentWorkspace = getCurrentWorkspace();
if (!currentWorkspace) {