Web: SettingsStore: Fixed warnings of mobx

This commit is contained in:
Alexey Safronov 2021-03-03 14:46:05 +03:00
parent 3fecff3307
commit 4db48870cf

View File

@ -118,6 +118,8 @@ class SettingsStore {
getPortalTimezones: action,
setHeaderVisible: action,
setIsTabletView: action,
setValue: action,
setArticlePinned: action,
});
}
@ -127,18 +129,21 @@ class SettingsStore {
return `https://helpcenter.onlyoffice.com/${lang}/installation/groups-authorization-keys.aspx`;
}
setValue = (key, value) => {
this[key] = value;
};
getSettings = async () => {
const newSettings = await api.settings.getSettings();
Object.keys(newSettings).map((key) => {
if (key in this) {
this[key] = newSettings[key];
this.setValue(key, newSettings[key]);
if (key === "culture" && !localStorage.getItem(LANGUAGE)) {
localStorage.setItem(LANGUAGE, newSettings[key]);
}
} else if (key === "passwordHash") {
this.hashSettings = newSettings[key];
this.setValue("hashSettings", newSettings[key]);
}
});