From 3a2c2513cff3aafa15fe900f725925231d7e8573 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 13 Apr 2022 12:54:53 +0300 Subject: [PATCH] Fix loading if coEditing==null --- apps/documenteditor/main/app/controller/Main.js | 8 ++++---- apps/documenteditor/mobile/src/controller/Main.jsx | 2 +- apps/presentationeditor/main/app/controller/Main.js | 8 ++++---- apps/presentationeditor/mobile/src/controller/Main.jsx | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 8 ++++---- apps/spreadsheeteditor/mobile/src/controller/Main.jsx | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 9d38616e0..075c2b5fd 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -473,7 +473,7 @@ define([ docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); @@ -1549,10 +1549,10 @@ define([ // change = true by default in editor this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true - this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || + this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && - (this.appOptions.canLiveView ? !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) : - (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ; + (this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) : + (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ; this.loadCoAuthSettings(); this.applyModeCommonElements(); diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 8675fc898..ad7558b87 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -133,7 +133,7 @@ class MainController extends Component { docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); let enable = !this.editorConfig.customization || (this.editorConfig.customization.macros !== false); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 066c9822f..d62ba8a12 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -430,7 +430,7 @@ define([ docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); @@ -1196,10 +1196,10 @@ define([ // change = true by default in editor this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true - this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || + this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && - (this.appOptions.canLiveView ? !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) : - (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ; + (this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) : + (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ; this.loadCoAuthSettings(); this.applyModeCommonElements(); diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index a28803971..f9d8ed33f 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -124,7 +124,7 @@ class MainController extends Component { docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); let enable = !this.editorConfig.customization || (this.editorConfig.customization.macros !== false); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index b97a21800..fd66dbd5d 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -504,7 +504,7 @@ define([ docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); @@ -1285,10 +1285,10 @@ define([ // change = true by default in editor this.appOptions.canLiveView = true; //params.asc_canLiveViewer(); // viewer: change=false by default when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.appOptions.canCoAuthoring && - !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || + !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && - (this.appOptions.canLiveView ? !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) : - (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ; + (this.appOptions.canLiveView ? !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) : + (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true)) ; if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) { this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index 0b7925cf3..37d678f56 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -171,7 +171,7 @@ class MainController extends Component { docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); const appOptions = this.props.storeAppOptions;