diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index de7abebe4..4a9b0e39a 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -257,6 +257,14 @@ class MainController extends Component { appSettings.changeShowTableEmptyLine(value); this.api.put_ShowTableEmptyLine(value); + value = LocalStorage.getBool('mobile-view', true); + + if(value) { + this.api.ChangeReaderMode(); + } else { + appOptions.changeMobileView(); + } + if (appOptions.isEdit && this.needToUpdateVersion) { Common.Notifications.trigger('api:disconnect'); } @@ -273,7 +281,6 @@ class MainController extends Component { this.api.Resize(); this.api.zoomFitToWidth(); this.api.asc_GetDefaultTableStyles && setTimeout(() => {this.api.asc_GetDefaultTableStyles()}, 1); - this.api.ChangeReaderMode(); this.applyLicense(); Common.Notifications.trigger('document:ready'); diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index 93e6a4dda..a35349716 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -4,6 +4,7 @@ import { f7 } from 'framework7-react'; import { useTranslation } from 'react-i18next'; import ToolbarView from "../view/Toolbar"; import {storeAppOptions} from "../store/appOptions"; +import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage"; const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => { const {t} = useTranslation(); @@ -145,7 +146,9 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto const changeMobileView = () => { const api = Common.EditorApi.get(); + const isMobileView = appOptions.isMobileView; + LocalStorage.setBool('mobile-view', !isMobileView); appOptions.changeMobileView(); api.ChangeReaderMode(); } diff --git a/apps/documenteditor/mobile/src/controller/settings/Settings.jsx b/apps/documenteditor/mobile/src/controller/settings/Settings.jsx index 951ff7d87..556638d85 100644 --- a/apps/documenteditor/mobile/src/controller/settings/Settings.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/Settings.jsx @@ -5,6 +5,7 @@ import { observer, inject } from "mobx-react"; import {Device} from '../../../../../common/mobile/utils/device'; import SettingsView from "../../view/settings/Settings"; +import {LocalStorage} from "../../../../../common/mobile/utils/LocalStorage"; const Settings = props => { useEffect(() => { @@ -84,7 +85,9 @@ const Settings = props => { const onChangeMobileView = async () => { 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();