mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
refactor: migrate environment to BUILD_CONFIG (#8206)
This commit is contained in:
@@ -23,7 +23,7 @@ export function registerAffineCreationCommands({
|
||||
category: 'affine:creation',
|
||||
label: t['com.affine.cmdk.affine.new-page'](),
|
||||
icon: <PlusIcon />,
|
||||
keyBinding: environment.isElectron
|
||||
keyBinding: BUILD_CONFIG.isElectron
|
||||
? {
|
||||
binding: '$mod+N',
|
||||
skipRegister: true,
|
||||
@@ -73,7 +73,7 @@ export function registerAffineCreationCommands({
|
||||
icon: <ImportIcon />,
|
||||
label: t['com.affine.cmdk.affine.import-workspace'](),
|
||||
preconditionStrategy: () => {
|
||||
return environment.isElectron;
|
||||
return BUILD_CONFIG.isElectron;
|
||||
},
|
||||
run() {
|
||||
track.$.cmdk.workspace.createWorkspace({
|
||||
|
||||
@@ -183,7 +183,7 @@ export function registerAffineSettingsCommands({
|
||||
`,
|
||||
category: 'affine:settings',
|
||||
icon: <SettingsIcon />,
|
||||
preconditionStrategy: () => environment.isElectron,
|
||||
preconditionStrategy: () => BUILD_CONFIG.isElectron,
|
||||
run() {
|
||||
track.$.cmdk.settings.changeAppSetting({
|
||||
key: 'clientBorder',
|
||||
@@ -231,7 +231,7 @@ export function registerAffineSettingsCommands({
|
||||
]()}`,
|
||||
category: 'affine:settings',
|
||||
icon: <SettingsIcon />,
|
||||
preconditionStrategy: () => environment.isElectron,
|
||||
preconditionStrategy: () => BUILD_CONFIG.isElectron,
|
||||
run() {
|
||||
track.$.cmdk.settings.changeAppSetting({
|
||||
key: 'enableNoisyBackground',
|
||||
@@ -257,7 +257,8 @@ export function registerAffineSettingsCommands({
|
||||
]()}`,
|
||||
category: 'affine:settings',
|
||||
icon: <SettingsIcon />,
|
||||
preconditionStrategy: () => environment.isElectron && environment.isMacOs,
|
||||
preconditionStrategy: () =>
|
||||
BUILD_CONFIG.isElectron && environment.isMacOs,
|
||||
run() {
|
||||
track.$.cmdk.settings.changeAppSetting({
|
||||
key: 'enableBlurBackground',
|
||||
|
||||
Reference in New Issue
Block a user