[DE mobile] Added macros mode initialization when loading a document

This commit is contained in:
JuliaSvinareva 2021-04-12 15:42:20 +03:00
parent 0f76a31706
commit cf7141f756
3 changed files with 13 additions and 4 deletions

View file

@ -26,7 +26,8 @@ import LongActionsController from "./LongActions";
"storeParagraphSettings", "storeParagraphSettings",
"storeTableSettings", "storeTableSettings",
"storeDocumentInfo", "storeDocumentInfo",
"storeChartSettings" "storeChartSettings",
"storeApplicationSettings"
) )
class MainController extends Component { class MainController extends Component {
constructor(props) { constructor(props) {
@ -83,6 +84,15 @@ class MainController extends Component {
this.editorConfig.lang && this.api.asc_setLocale(this.editorConfig.lang); 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'); Common.Notifications.trigger('configOptionsFill');
}; };

View file

@ -57,8 +57,7 @@ class ApplicationSettingsController extends Component {
} }
setMacrosSettings(value) { setMacrosSettings(value) {
// Common.Utils.InternalSettings.set("de-mobile-macros-mode", +value); LocalStorage.setItem("de-mobile-macros-mode", value);
// Common.localStorage.setItem("de-mobile-macros-mode", +value);
} }
render() { render() {

View file

@ -106,7 +106,7 @@ const PageMacrosSettings = props => {
const changeMacros = value => { const changeMacros = value => {
store.changeMacrosSettings(value); store.changeMacrosSettings(value);
// props.setMacrosSettings(value); props.setMacrosSettings(value);
}; };
return ( return (