Add support for disabling spell check (#22220)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
a620ff2b6a
commit
1e445a75a9
1 changed files with 13 additions and 4 deletions
|
@ -175,9 +175,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
|||
* Return true if platform supports multi-language
|
||||
* spell-checking, otherwise false.
|
||||
*/
|
||||
public supportsMultiLanguageSpellCheck(): boolean {
|
||||
// Electron uses OS spell checking on macOS, so no need for in-app options
|
||||
if (isMac) return false;
|
||||
public supportsSpellCheckSettings(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -305,7 +303,18 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
|||
return this.ipc.call('setLanguage', preferredLangs);
|
||||
}
|
||||
|
||||
public setSpellCheckLanguages(preferredLangs: string[]) {
|
||||
public setSpellCheckEnabled(enabled: boolean): void {
|
||||
this.ipc.call('setSpellCheckEnabled', enabled).catch(error => {
|
||||
logger.log("Failed to send setSpellCheckEnabled IPC to Electron");
|
||||
logger.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
public async getSpellCheckEnabled(): Promise<boolean> {
|
||||
return this.ipc.call('getSpellCheckEnabled');
|
||||
}
|
||||
|
||||
public setSpellCheckLanguages(preferredLangs: string[]): void {
|
||||
this.ipc.call('setSpellCheckLanguages', preferredLangs).catch(error => {
|
||||
logger.log("Failed to send setSpellCheckLanguages IPC to Electron");
|
||||
logger.error(error);
|
||||
|
|
Loading…
Reference in a new issue