Web: SettingsStore: Fixed warnings of mobx
This commit is contained in:
parent
3fecff3307
commit
4db48870cf
@ -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]);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user