mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08:00
refactor(core): move setting dialog to workspace scope (#9706)
This commit is contained in:
@@ -2,18 +2,18 @@ import type { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import { ContactWithUsIcon, NewIcon } from '@blocksuite/icons/rc';
|
||||
|
||||
import type { GlobalDialogService } from '../modules/dialogs';
|
||||
import type { WorkspaceDialogService } from '../modules/dialogs';
|
||||
import type { UrlService } from '../modules/url';
|
||||
import { registerAffineCommand } from './registry';
|
||||
|
||||
export function registerAffineHelpCommands({
|
||||
t,
|
||||
urlService,
|
||||
globalDialogService,
|
||||
workspaceDialogService,
|
||||
}: {
|
||||
t: ReturnType<typeof useI18n>;
|
||||
urlService: UrlService;
|
||||
globalDialogService: GlobalDialogService;
|
||||
workspaceDialogService: WorkspaceDialogService;
|
||||
}) {
|
||||
const unsubs: Array<() => void> = [];
|
||||
unsubs.push(
|
||||
@@ -36,7 +36,7 @@ export function registerAffineHelpCommands({
|
||||
label: t['com.affine.cmdk.affine.contact-us'](),
|
||||
run() {
|
||||
track.$.cmdk.help.contactUs();
|
||||
globalDialogService.open('setting', {
|
||||
workspaceDialogService.open('setting', {
|
||||
activeTab: 'about',
|
||||
});
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { createStore } from 'jotai';
|
||||
|
||||
import { openWorkspaceListModalAtom } from '../components/atoms';
|
||||
import type { useNavigateHelper } from '../components/hooks/use-navigate-helper';
|
||||
import type { GlobalDialogService } from '../modules/dialogs';
|
||||
import type { WorkspaceDialogService } from '../modules/dialogs';
|
||||
import { registerAffineCommand } from './registry';
|
||||
|
||||
export function registerAffineNavigationCommands({
|
||||
@@ -14,13 +14,13 @@ export function registerAffineNavigationCommands({
|
||||
store,
|
||||
docCollection,
|
||||
navigationHelper,
|
||||
globalDialogService,
|
||||
workspaceDialogService,
|
||||
}: {
|
||||
t: ReturnType<typeof useI18n>;
|
||||
store: ReturnType<typeof createStore>;
|
||||
navigationHelper: ReturnType<typeof useNavigateHelper>;
|
||||
docCollection: Workspace;
|
||||
globalDialogService: GlobalDialogService;
|
||||
workspaceDialogService: WorkspaceDialogService;
|
||||
}) {
|
||||
const unsubs: Array<() => void> = [];
|
||||
unsubs.push(
|
||||
@@ -96,7 +96,7 @@ export function registerAffineNavigationCommands({
|
||||
keyBinding: '$mod+,',
|
||||
run() {
|
||||
track.$.cmdk.settings.openSettings();
|
||||
globalDialogService.open('setting', {
|
||||
workspaceDialogService.open('setting', {
|
||||
activeTab: 'appearance',
|
||||
});
|
||||
},
|
||||
@@ -111,7 +111,7 @@ export function registerAffineNavigationCommands({
|
||||
label: t['com.affine.cmdk.affine.navigation.open-account-settings'](),
|
||||
run() {
|
||||
track.$.cmdk.settings.openSettings({ to: 'account' });
|
||||
globalDialogService.open('setting', {
|
||||
workspaceDialogService.open('setting', {
|
||||
activeTab: 'account',
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user