-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
172 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/frontend/core/src/modules/editor-setting/services/spell-check-setting.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { | ||
SpellCheckStateKey, | ||
SpellCheckStateSchema, | ||
} from '@affine/electron/main/shared-state-schema'; | ||
import type { GlobalStateService } from '@toeverything/infra'; | ||
import { LiveData, Service } from '@toeverything/infra'; | ||
|
||
const SPELL_CHECK_SETTING_KEY: SpellCheckStateKey = 'spellCheckState'; | ||
|
||
export class SpellCheckSettingService extends Service { | ||
constructor(private readonly globalStateService: GlobalStateService) { | ||
super(); | ||
} | ||
|
||
enabled$ = LiveData.from( | ||
this.globalStateService.globalState.watch< | ||
SpellCheckStateSchema | undefined | ||
>(SPELL_CHECK_SETTING_KEY), | ||
{ enabled: false } | ||
); | ||
|
||
setEnabled(enabled: boolean) { | ||
this.globalStateService.globalState.set(SPELL_CHECK_SETTING_KEY, { | ||
enabled, | ||
}); | ||
} | ||
} |
Oops, something went wrong.