mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 09:46:09 +03:00
Use getSpellCheckLanguages() instead of a setting
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
305d64cda8
commit
1ba512af2a
2 changed files with 14 additions and 1 deletions
|
@ -250,6 +250,10 @@ export default abstract class BasePlatform {
|
||||||
|
|
||||||
setSpellCheckLanguages(preferredLangs: string[]) {}
|
setSpellCheckLanguages(preferredLangs: string[]) {}
|
||||||
|
|
||||||
|
getSpellCheckLanguages(): Promise<string[]> | null {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
getAvailableSpellCheckLanguages(): Promise<string[]> | null {
|
getAvailableSpellCheckLanguages(): Promise<string[]> | null {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
language: languageHandler.getCurrentLanguage(),
|
language: languageHandler.getCurrentLanguage(),
|
||||||
spellCheckLanguages: SettingsStore.getValue("spell-check-languages", null, false),
|
spellCheckLanguages: [],
|
||||||
haveIdServer: Boolean(MatrixClientPeg.get().getIdentityServerUrl()),
|
haveIdServer: Boolean(MatrixClientPeg.get().getIdentityServerUrl()),
|
||||||
serverSupportsSeparateAddAndBind: null,
|
serverSupportsSeparateAddAndBind: null,
|
||||||
idServerHasUnsignedTerms: false,
|
idServerHasUnsignedTerms: false,
|
||||||
|
@ -87,6 +87,15 @@ export default class GeneralUserSettingsTab extends React.Component {
|
||||||
this._getThreepidState();
|
this._getThreepidState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async componentDidMount() {
|
||||||
|
const plaf = PlatformPeg.get();
|
||||||
|
if (plaf) {
|
||||||
|
this.setState({
|
||||||
|
spellCheckLanguages: await plaf.getSpellCheckLanguages(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue