[PE mobile] Correct application settings

This commit is contained in:
SergeyEzhin 2021-06-07 13:13:14 +03:00
parent 9f50f96c27
commit f9aefa5170

View file

@ -1,10 +1,19 @@
import React, { Component } from "react";
import { ApplicationSettings } from "../../view/settings/ApplicationSettings";
import { LocalStorage } from '../../../../../common/mobile/utils/LocalStorage';
import {observer, inject} from "mobx-react";
class ApplicationSettingsController extends Component {
constructor(props) {
super(props);
const valueUnitMeasurement = LocalStorage.getItem("pe-mobile-settings-unit");
const valueSpellCheck = LocalStorage.getBool("pe-mobile-spellcheck");
const valueMacrosMode = LocalStorage.getItem("pe-mobile-macros-mode");
typeof valueUnitMeasurement !== 'undefined' && this.props.storeApplicationSettings.changeUnitMeasurement(valueUnitMeasurement);
typeof valueSpellCheck !== 'undefined' && this.props.storeApplicationSettings.changeSpellCheck(valueSpellCheck);
typeof valueMacrosMode !== 'undefined' && this.props.storeApplicationSettings.changeMacrosSettings(valueMacrosMode);
}
setUnitMeasurement(value) {
@ -37,4 +46,4 @@ class ApplicationSettingsController extends Component {
}
export default ApplicationSettingsController;
export default inject("storeApplicationSettings")(observer(ApplicationSettingsController));