Removed unnecessary functions

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-02-18 19:54:54 +01:00
parent ed02503462
commit 2ebc1252cb
No known key found for this signature in database
GPG key ID: 9760693FDD98A790
3 changed files with 25 additions and 32 deletions

View file

@ -18,7 +18,7 @@ import React from 'react';
import Dropdown from "../../views/elements/Dropdown"
import * as sdk from '../../../index';
import * as languageHandler from '../../../languageHandler';
import PlatformPeg from "../../../PlatformPeg";
import SettingsStore from "../../../settings/SettingsStore";
import { _t } from "../../../languageHandler";
@ -52,23 +52,26 @@ export default class SpellCheckLanguagesDropdown extends React.Component<SpellCh
}
componentDidMount() {
languageHandler.getAvailableSpellCheckLanguages().then((languages) => {
languages.sort(function(a, b) {
if (a < b) return -1;
if (a > b) return 1;
return 0;
});
const langs = [];
languages.forEach((language) => {
langs.push({
label: language,
value: language,
const plaf = PlatformPeg.get();
if (plaf) {
plaf.getAvailableSpellCheckLanguages().then((languages) => {
languages.sort(function(a, b) {
if (a < b) return -1;
if (a > b) return 1;
return 0;
});
const langs = [];
languages.forEach((language) => {
langs.push({
label: language,
value: language,
})
})
})
this.setState({languages: langs});
}).catch((e) => {
this.setState({languages: ['en']});
});
this.setState({languages: langs});
}).catch((e) => {
this.setState({languages: ['en']});
});
}
}
_onSearchChange(search) {