From 5505fb3f476511affcc41665d00348e4e6b8cf64 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Fri, 2 Sep 2022 15:16:02 +0300 Subject: [PATCH] [DE mobile] Fix Bug 58759 --- .../mobile/src/controller/Toolbar.jsx | 1 - .../mobile/src/controller/settings/Settings.jsx | 14 +++++--------- apps/documenteditor/mobile/src/view/Toolbar.jsx | 10 ++++++---- .../mobile/src/view/settings/Settings.jsx | 9 +++++---- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index 633b318bf..69056e834 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -168,7 +168,6 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto onEditDocument={onEditDocument} isDisconnected={isDisconnected} isViewer={isViewer} - // turnOffViewerMode={turnOffViewerMode} turnOnViewerMode={turnOnViewerMode} isMobileView={isMobileView} changeMobileView={changeMobileView} diff --git a/apps/documenteditor/mobile/src/controller/settings/Settings.jsx b/apps/documenteditor/mobile/src/controller/settings/Settings.jsx index 556638d85..809bd1e28 100644 --- a/apps/documenteditor/mobile/src/controller/settings/Settings.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/Settings.jsx @@ -82,19 +82,15 @@ const Settings = props => { }, 0); }; - const onChangeMobileView = async () => { + const onChangeMobileView = () => { const api = Common.EditorApi.get(); const appOptions = props.storeAppOptions; const isMobileView = appOptions.isMobileView; - await LocalStorage.setBool('mobile-view', !isMobileView); - await appOptions.changeMobileView(); - await api.ChangeReaderMode(); - - if(Device.phone) { - await closeModal(); - } - } + LocalStorage.setBool('mobile-view', !isMobileView); + appOptions.changeMobileView(); + api.ChangeReaderMode(); + }; return { onUndoClick: props.onUndo, onRedoClick: props.onRedo })} - {(isViewer || !Device.phone) && isAvailableExt && { - props.changeMobileView(); - props.openOptions('snackbar'); + {(isViewer || !Device.phone) && isAvailableExt && { + e.target.closest('.link').classList.add('disabled'); + await props.changeMobileView(); + await props.openOptions('snackbar'); setTimeout(() => { props.closeOptions('snackbar'); - }, 500); + e.target.closest('.link').classList.remove('disabled'); + }, 1500); }}>} {(props.showEditDocument && !isViewer) && diff --git a/apps/documenteditor/mobile/src/view/settings/Settings.jsx b/apps/documenteditor/mobile/src/view/settings/Settings.jsx index c26dfa79d..ec29f58c0 100644 --- a/apps/documenteditor/mobile/src/view/settings/Settings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/Settings.jsx @@ -163,12 +163,13 @@ const SettingsList = inject("storeAppOptions", "storeReview")(observer(props => {!isViewer && Device.phone && - { - props.onChangeMobileView(); - props.openOptions('snackbar'); + { + await props.onChangeMobileView(); + await closeModal(); + await props.openOptions('snackbar'); setTimeout(() => { props.closeOptions('snackbar'); - }, 1000); + }, 1500); }} /> }