diff --git a/apps/documenteditor/mobile/src/controller/LongActions.jsx b/apps/documenteditor/mobile/src/controller/LongActions.jsx index 94dca84c8..da831fd29 100644 --- a/apps/documenteditor/mobile/src/controller/LongActions.jsx +++ b/apps/documenteditor/mobile/src/controller/LongActions.jsx @@ -39,7 +39,11 @@ const LongActionsController = () => { api.asc_unregisterCallback('asc_onEndAction', onLongActionEnd); api.asc_unregisterCallback('asc_onOpenDocumentProgress', onOpenDocument); - Common.Notifications.off('preloader:endAction', onLongActionEnd); + Common.Notifications.off('preloader:endAction', (type, id) => { + if (stackLongActions.exist({id: id, type: type})) { + onLongActionEnd(type, id); + } + }); Common.Notifications.off('preloader:beginAction', onLongActionBegin); Common.Notifications.off('preloader:close', closePreloader); }) diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index c64ce5ceb..67b4f8607 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -34,6 +34,7 @@ class MainController extends Component { window.editorType = 'de'; this.LoadingDocument = -256; + this.ApplyEditRights = -255; this._state = { licenseType: false, @@ -342,12 +343,12 @@ class MainController extends Component { this.api.asc_registerCallback('asc_onDocumentModifiedChanged', this.onDocumentModifiedChanged.bind(this)); this.api.asc_registerCallback('asc_onDocumentCanSaveChanged', this.onDocumentCanSaveChanged.bind(this)); - //if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) { - // me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], ApplyEditRights); - //} else if (!this._isDocReady) { - // me.hidePreloader(); - // me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); - //} + Common.Notifications.trigger('preloader:close'); + Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.ApplyEditRights); + + if (!this._isDocReady) { + Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument); + } // Message on window close window.onbeforeunload = this.onBeforeUnload.bind(this); diff --git a/apps/presentationeditor/mobile/src/controller/LongActions.jsx b/apps/presentationeditor/mobile/src/controller/LongActions.jsx index f5b5e50b7..18669369f 100644 --- a/apps/presentationeditor/mobile/src/controller/LongActions.jsx +++ b/apps/presentationeditor/mobile/src/controller/LongActions.jsx @@ -39,7 +39,11 @@ const LongActionsController = () => { api.asc_unregisterCallback('asc_onEndAction', onLongActionEnd); api.asc_unregisterCallback('asc_onOpenDocumentProgress', onOpenDocument); - Common.Notifications.off('preloader:endAction', onLongActionEnd); + Common.Notifications.off('preloader:endAction', (type, id) => { + if (stackLongActions.exist({id: id, type: type})) { + onLongActionEnd(type, id); + } + }); Common.Notifications.off('preloader:beginAction', onLongActionBegin); Common.Notifications.off('preloader:close', closePreloader); }) diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index 8585fdb63..f7aa2b066 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -33,6 +33,7 @@ class MainController extends Component { window.editorType = 'pe'; this.LoadingDocument = -256; + this.ApplyEditRights = -255; this._state = { licenseType: false, @@ -244,12 +245,12 @@ class MainController extends Component { this.api.asc_registerCallback('asc_onDocumentModifiedChanged', this.onDocumentModifiedChanged.bind(this)); this.api.asc_registerCallback('asc_onDocumentCanSaveChanged', this.onDocumentCanSaveChanged.bind(this)); - //if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType['BlockInteraction']})) { - // me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], ApplyEditRights); - //} else if (!this._isDocReady) { - // me.hidePreloader(); - // me.onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); - //} + Common.Notifications.trigger('preloader:close'); + Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.ApplyEditRights); + + if (!this._isDocReady) { + Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument); + } // Message on window close window.onbeforeunload = this.onBeforeUnload.bind(this); diff --git a/apps/spreadsheeteditor/mobile/src/controller/LongActions.jsx b/apps/spreadsheeteditor/mobile/src/controller/LongActions.jsx index 463a37367..9a498dbcb 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/LongActions.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/LongActions.jsx @@ -41,7 +41,11 @@ const LongActionsController = () => { api.asc_unregisterCallback('asc_onOpenDocumentProgress', onOpenDocument); api.asc_unregisterCallback('asc_onConfirmAction', onConfirmAction); - Common.Notifications.off('preloader:endAction', onLongActionEnd); + Common.Notifications.off('preloader:endAction', (type, id) => { + if (stackLongActions.exist({id: id, type: type})) { + onLongActionEnd(type, id); + } + }); Common.Notifications.off('preloader:beginAction', onLongActionBegin); Common.Notifications.off('preloader:close', closePreloader); }) diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index 4d762377c..92889cf34 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -403,12 +403,12 @@ class MainController extends Component { this.api.asc_registerCallback('asc_onDocumentModifiedChanged', this.onDocumentModifiedChanged.bind(this)); this.api.asc_registerCallback('asc_onDocumentCanSaveChanged', this.onDocumentCanSaveChanged.bind(this)); - //if (me.stackLongActions.exist({id: ApplyEditRights, type: Asc.c_oAscAsyncActionType.BlockInteraction})) { - //me.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, ApplyEditRights); - //} else if (!this._isDocReady) { - //me.hidePreloader(); - //me.onLongActionBegin(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); - //} + Common.Notifications.trigger('preloader:close'); + Common.Notifications.trigger('preloader:endAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.ApplyEditRights); + + if (!this._isDocReady) { + Common.Notifications.trigger('preloader:beginAction', Asc.c_oAscAsyncActionType['BlockInteraction'], this.LoadingDocument); + } // Message on window close window.onbeforeunload = this.onBeforeUnload.bind(this);