mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-20 07:47:19 +08:00
@@ -142,12 +142,6 @@ window.addEventListener('unload', () => {
|
|||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
});
|
});
|
||||||
|
|
||||||
events?.applicationMenu.openAboutPageInSettingModal(() =>
|
|
||||||
frameworkProvider.get(WorkspaceDialogService).open('setting', {
|
|
||||||
activeTab: 'about',
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
function getCurrentWorkspace() {
|
function getCurrentWorkspace() {
|
||||||
const currentWorkspaceId = frameworkProvider
|
const currentWorkspaceId = frameworkProvider
|
||||||
.get(GlobalContextService)
|
.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 => {
|
events?.applicationMenu.onNewPageAction(type => {
|
||||||
const currentWorkspace = getCurrentWorkspace();
|
const currentWorkspace = getCurrentWorkspace();
|
||||||
if (!currentWorkspace) {
|
if (!currentWorkspace) {
|
||||||
|
|||||||
@@ -60,8 +60,9 @@ export function useRegisterWorkspaceCommands() {
|
|||||||
const appSidebarService = useService(AppSidebarService);
|
const appSidebarService = useService(AppSidebarService);
|
||||||
const i18n = useService(I18nService).i18n;
|
const i18n = useService(I18nService).i18n;
|
||||||
|
|
||||||
const quitAndInstall =
|
const desktopApiService = useServiceOptional(DesktopApiService);
|
||||||
useServiceOptional(DesktopApiService)?.handler.updater.quitAndInstall;
|
|
||||||
|
const quitAndInstall = desktopApiService?.handler.updater.quitAndInstall;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const unsub = registerCMDKCommand(cmdkQuickSearchService);
|
const unsub = registerCMDKCommand(cmdkQuickSearchService);
|
||||||
@@ -124,7 +125,6 @@ export function useRegisterWorkspaceCommands() {
|
|||||||
};
|
};
|
||||||
}, [editorSettingService, store, t, theme]);
|
}, [editorSettingService, store, t, theme]);
|
||||||
|
|
||||||
// register AffineLanguageCommands
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const unsub = registerAffineLanguageCommands({
|
const unsub = registerAffineLanguageCommands({
|
||||||
i18n,
|
i18n,
|
||||||
|
|||||||
Reference in New Issue
Block a user