diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index 8975613567..8f1ca6aee5 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -410,15 +410,18 @@ class MainController extends Component { onChangeProtectSheet() { const storeWorksheets = this.props.storeWorksheets; let {wsLock, wsProps} = this.getWSProps(true); - - storeWorksheets.setWsLock(wsLock); - storeWorksheets.setWsProps(wsProps); + + if(wsProps) { + storeWorksheets.setWsLock(wsLock); + storeWorksheets.setWsProps(wsProps); + } } getWSProps(update) { const storeAppOptions = this.props.storeAppOptions; let wsProtection = {}; - if (!storeAppOptions.config || !storeAppOptions.isEdit && !storeAppOptions.isRestrictedEdit) return; + if (!storeAppOptions.config || !storeAppOptions.isEdit && !storeAppOptions.isRestrictedEdit) + return wsProtection; if (update) { let wsLock = !!this.api.asc_isProtectedSheet(); @@ -436,9 +439,9 @@ class MainController extends Component { } wsProtection = {wsLock, wsProps}; + + return wsProtection; } - - return wsProtection; } _onLongActionEnd(type, id) { diff --git a/apps/spreadsheeteditor/mobile/src/store/sheets.js b/apps/spreadsheeteditor/mobile/src/store/sheets.js index 7447b68723..e119640026 100644 --- a/apps/spreadsheeteditor/mobile/src/store/sheets.js +++ b/apps/spreadsheeteditor/mobile/src/store/sheets.js @@ -101,7 +101,7 @@ export class storeWorksheets { this.isProtectedWorkbook = value; } - wsProps = {}; + wsProps; setWsProps(value) { this.wsProps = value; }