[DE mobile] Added macros mode initialization when loading a document
This commit is contained in:
parent
0f76a31706
commit
cf7141f756
|
@ -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');
|
||||
};
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -106,7 +106,7 @@ const PageMacrosSettings = props => {
|
|||
|
||||
const changeMacros = value => {
|
||||
store.changeMacrosSettings(value);
|
||||
// props.setMacrosSettings(value);
|
||||
props.setMacrosSettings(value);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue