Enable/disable spellchecker setting without relaunch

This commit is contained in:
AkiraFukushima 2021-03-26 01:35:33 +09:00
parent 2277097f75
commit acf7c74ea3
2 changed files with 3 additions and 4 deletions

View File

@ -1022,6 +1022,8 @@ ipcMain.handle('change-language', async (_: IpcMainInvokeEvent, value: string) =
})
ipcMain.handle('toggle-spellchecker', async (_: IpcMainInvokeEvent, value: boolean) => {
mainWindow?.webContents.session.setSpellCheckerEnabled(value)
const preferences = new Preferences(preferencesDBPath)
const conf = await preferences.update({
language: {

View File

@ -26,7 +26,6 @@
>{{ language.name }}</el-checkbox
>
</el-checkbox-group>
<p class="notice">{{ $t('preferences.language.notice') }}</p>
</el-form-item>
</el-form>
</div>
@ -76,9 +75,7 @@ export default {
return this.$store.state.Preferences.Language.language.spellchecker.enabled
},
set(value) {
this.$store.dispatch('Preferences/Language/toggleSpellchecker', value).then(() => {
this.confirm()
})
this.$store.dispatch('Preferences/Language/toggleSpellchecker', value)
}
},
spellcheckLanguages: {