From 858c7a3ad46dc48effb5acd1670900b4d8a86395 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 23 Sep 2021 23:45:10 +0300 Subject: [PATCH] [PE mobile] skip using "Suspense" option for app's launch --- .../common/mobile/resources/less/skeleton.css | 4 ++++ apps/presentationeditor/mobile/src/app.js | 4 ++-- .../mobile/src/controller/ContextMenu.jsx | 6 ++++-- .../mobile/src/controller/Error.jsx | 2 +- .../mobile/src/controller/LongActions.jsx | 8 +++++--- .../mobile/src/controller/Main.jsx | 6 ++++-- .../mobile/src/index_dev.html | 19 +++++++++++++++++-- .../presentationeditor/mobile/src/lib/i18n.js | 3 +++ .../mobile/src/page/main.jsx | 5 +++++ 9 files changed, 45 insertions(+), 12 deletions(-) diff --git a/apps/common/mobile/resources/less/skeleton.css b/apps/common/mobile/resources/less/skeleton.css index 69361779e..8ec1af34b 100644 --- a/apps/common/mobile/resources/less/skeleton.css +++ b/apps/common/mobile/resources/less/skeleton.css @@ -34,6 +34,10 @@ body { background-color: #40865c; } +.skl-navbar.skl-navbar--slide { + background-color: #aa5252; +} + .skl-navbar::before { content: ''; position: absolute; diff --git a/apps/presentationeditor/mobile/src/app.js b/apps/presentationeditor/mobile/src/app.js index e6dabe8f6..49a9db3fb 100644 --- a/apps/presentationeditor/mobile/src/app.js +++ b/apps/presentationeditor/mobile/src/app.js @@ -35,9 +35,9 @@ Framework7.use(Framework7React) ReactDOM.render( - + {/**/} - + {/**/} , document.getElementById('app'), diff --git a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx index 3fbdd6566..d506ee3f1 100644 --- a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx @@ -40,8 +40,10 @@ class ContextMenu extends ContextMenuController { super.componentWillUnmount(); const api = Common.EditorApi.get(); - api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment); - api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment); + if ( api ) { + api.asc_unregisterCallback('asc_onShowComment', this.onApiShowComment); + api.asc_unregisterCallback('asc_onHideComment', this.onApiHideComment); + } } diff --git a/apps/presentationeditor/mobile/src/controller/Error.jsx b/apps/presentationeditor/mobile/src/controller/Error.jsx index 6fd24f0e2..e2784d2c7 100644 --- a/apps/presentationeditor/mobile/src/controller/Error.jsx +++ b/apps/presentationeditor/mobile/src/controller/Error.jsx @@ -13,7 +13,7 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu }); return () => { const api = Common.EditorApi.get(); - api.asc_unregisterCallback('asc_onError', onError); + if ( api ) api.asc_unregisterCallback('asc_onError', onError); } }); diff --git a/apps/presentationeditor/mobile/src/controller/LongActions.jsx b/apps/presentationeditor/mobile/src/controller/LongActions.jsx index 8ce54677f..378f11865 100644 --- a/apps/presentationeditor/mobile/src/controller/LongActions.jsx +++ b/apps/presentationeditor/mobile/src/controller/LongActions.jsx @@ -35,9 +35,11 @@ const LongActionsController = () => { return (() => { const api = Common.EditorApi.get(); - api.asc_unregisterCallback('asc_onStartAction', onLongActionBegin); - api.asc_unregisterCallback('asc_onEndAction', onLongActionEnd); - api.asc_unregisterCallback('asc_onOpenDocumentProgress', onOpenDocument); + if ( api ) { + api.asc_unregisterCallback('asc_onStartAction', onLongActionBegin); + api.asc_unregisterCallback('asc_onEndAction', onLongActionEnd); + api.asc_unregisterCallback('asc_onOpenDocumentProgress', onOpenDocument); + } Common.Notifications.off('preloader:endAction', onLongActionEnd); Common.Notifications.off('preloader:beginAction', onLongActionBegin); diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index 5984a6681..575e34b7e 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -184,7 +184,6 @@ class MainController extends Component { }); Common.Notifications.trigger('engineCreated', this.api); - Common.EditorApi = {get: () => this.api}; this.appOptions = {}; this.bindEvents(); @@ -475,7 +474,9 @@ class MainController extends Component { } applyLicense () { - const _t = this._t; + const { t } = this.props; + const _t = t('Controller.Main', {returnObjects:true}); + const warnNoLicense = _t.warnNoLicense.replace(/%1/g, __COMPANY_NAME__); const warnNoLicenseUsers = _t.warnNoLicenseUsers.replace(/%1/g, __COMPANY_NAME__); const textNoLicenseTitle = _t.textNoLicenseTitle.replace(/%1/g, __COMPANY_NAME__); @@ -830,6 +831,7 @@ class MainController extends Component { } componentDidMount () { + Common.EditorApi = {get: () => this.api}; this.initSdk(); } } diff --git a/apps/presentationeditor/mobile/src/index_dev.html b/apps/presentationeditor/mobile/src/index_dev.html index 867a5ff63..aa7606e29 100644 --- a/apps/presentationeditor/mobile/src/index_dev.html +++ b/apps/presentationeditor/mobile/src/index_dev.html @@ -22,17 +22,28 @@ - - + + + +
+
+