diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index bdfc7fcff..4cb66c3ee 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -26,7 +26,8 @@ import LongActionsController from "./LongActions"; "storeParagraphSettings", "storeTableSettings", "storeDocumentInfo", - "storeChartSettings" + "storeChartSettings", + "storeApplicationSettings" ) class MainController extends Component { constructor(props) { @@ -83,6 +84,15 @@ class MainController extends Component { this.editorConfig.lang && this.api.asc_setLocale(this.editorConfig.lang); + let value = LocalStorage.getItem("de-mobile-macros-mode"); + if (value === null) { + value = this.editorConfig.customization ? this.editorConfig.customization.macrosMode : 'warn'; + value = (value === 'enable') ? 1 : (value === 'disable' ? 2 : 0); + } else { + value = parseInt(value); + } + this.props.storeApplicationSettings.changeMacrosSettings(value); + Common.Notifications.trigger('configOptionsFill'); }; diff --git a/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx index 4f8275494..c1239d2ab 100644 --- a/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx @@ -57,8 +57,7 @@ class ApplicationSettingsController extends Component { } setMacrosSettings(value) { - // Common.Utils.InternalSettings.set("de-mobile-macros-mode", +value); - // Common.localStorage.setItem("de-mobile-macros-mode", +value); + LocalStorage.setItem("de-mobile-macros-mode", value); } render() { diff --git a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx index 956195034..848438779 100644 --- a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx @@ -106,7 +106,7 @@ const PageMacrosSettings = props => { const changeMacros = value => { store.changeMacrosSettings(value); - // props.setMacrosSettings(value); + props.setMacrosSettings(value); }; return (