diff --git a/apps/common/mobile/lib/controller/collaboration/Comments.jsx b/apps/common/mobile/lib/controller/collaboration/Comments.jsx index 8e4951b1a..f0d773903 100644 --- a/apps/common/mobile/lib/controller/collaboration/Comments.jsx +++ b/apps/common/mobile/lib/controller/collaboration/Comments.jsx @@ -51,6 +51,7 @@ class CommentsController extends Component { this.usersStore = this.props.users; this.appOptions = this.props.storeAppOptions; this.storeComments = this.props.storeComments; + this.storeApplicationSettings = this.props.storeApplicationSettings; Common.Notifications.on('engineCreated', api => { api.asc_registerCallback('asc_onAddComment', this.addComment.bind(this)); @@ -74,6 +75,8 @@ class CommentsController extends Component { /** coauthoring begin **/ const isLiveCommenting = LocalStorage.getBool(`${window.editorType}-mobile-settings-livecomment`, true); const resolved = LocalStorage.getBool(`${window.editorType}-settings-resolvedcomment`, true); + this.storeApplicationSettings.changeDisplayComments(isLiveCommenting); + this.storeApplicationSettings.changeDisplayResolved(resolved); isLiveCommenting ? api.asc_showComments(resolved) : api.asc_hideComments(); /** coauthoring end **/ } @@ -583,7 +586,7 @@ class ViewCommentsController extends Component { } } -const _CommentsController = inject('storeAppOptions', 'storeComments', 'users')(observer(CommentsController)); +const _CommentsController = inject('storeAppOptions', 'storeComments', 'users', "storeApplicationSettings")(observer(CommentsController)); const _AddCommentController = inject('storeAppOptions', 'storeComments', 'users')(observer(AddCommentController)); const _EditCommentController = inject('storeComments', 'users')(observer(EditCommentController)); const _ViewCommentsController = inject('storeComments', 'users')(observer(withTranslation()(ViewCommentsController))); diff --git a/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx index 3a4ce7af5..b9cfc7d39 100644 --- a/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/ApplicationSettings.jsx @@ -7,26 +7,7 @@ class ApplicationSettingsController extends Component { constructor(props) { super(props); this.switchDisplayComments = this.switchDisplayComments.bind(this); - - const valueViewComments = LocalStorage.getBool("de-mobile-settings-livecomment"); - const valueResolvedComments = LocalStorage.getBool("de-settings-resolvedcomment"); - const valueUnitMeasurement = LocalStorage.getItem("de-mobile-settings-unit"); - const valueSpellCheck = LocalStorage.getBool("de-mobile-spellcheck"); - const valueNoCharacters = LocalStorage.getBool("de-mobile-no-characters"); - const valueHiddenBorders = LocalStorage.getBool("de-mobile-hidden-borders"); - const valueMacrosMode = LocalStorage.getItem("de-mobile-macros-mode"); - - if(typeof valueViewComments !== 'undefined') { - this.props.storeApplicationSettings.changeDisplayComments(valueViewComments); - this.props.storeAppOptions.changeCanViewComments(valueViewComments); - } - - typeof valueResolvedComments !== 'undefined' && this.props.storeApplicationSettings.changeDisplayResolved(valueResolvedComments); - typeof valueUnitMeasurement !== 'undefined' && this.props.storeApplicationSettings.changeUnitMeasurement(valueUnitMeasurement); - typeof valueSpellCheck !== 'undefined' && this.props.storeApplicationSettings.changeSpellCheck(valueSpellCheck); - typeof valueNoCharacters !== 'undefined' && this.props.storeApplicationSettings.changeNoCharacters(valueNoCharacters); - typeof valueHiddenBorders !== 'undefined' && this.props.storeApplicationSettings.changeShowTableEmptyLine(valueHiddenBorders); - typeof valueMacrosMode !== 'undefined' && this.props.storeApplicationSettings.changeMacrosSettings(valueMacrosMode); + this.props.storeApplicationSettings.changeUnitMeasurement(Common.Utils.Metric.getCurrentMetric()); } setUnitMeasurement(value) { diff --git a/apps/presentationeditor/mobile/src/controller/settings/ApplicationSettings.jsx b/apps/presentationeditor/mobile/src/controller/settings/ApplicationSettings.jsx index 44d520fa1..fce2d7d05 100644 --- a/apps/presentationeditor/mobile/src/controller/settings/ApplicationSettings.jsx +++ b/apps/presentationeditor/mobile/src/controller/settings/ApplicationSettings.jsx @@ -6,14 +6,7 @@ import {observer, inject} from "mobx-react"; class ApplicationSettingsController extends Component { constructor(props) { super(props); - - const valueUnitMeasurement = LocalStorage.getItem("pe-mobile-settings-unit"); - const valueSpellCheck = LocalStorage.getBool("pe-mobile-spellcheck"); - const valueMacrosMode = LocalStorage.getItem("pe-mobile-macros-mode"); - - typeof valueUnitMeasurement !== 'undefined' && this.props.storeApplicationSettings.changeUnitMeasurement(valueUnitMeasurement); - typeof valueSpellCheck !== 'undefined' && this.props.storeApplicationSettings.changeSpellCheck(valueSpellCheck); - typeof valueMacrosMode !== 'undefined' && this.props.storeApplicationSettings.changeMacrosSettings(valueMacrosMode); + this.props.storeApplicationSettings.changeUnitMeasurement(Common.Utils.Metric.getCurrentMetric()); } setUnitMeasurement(value) { diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/ApplicationSettings.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/ApplicationSettings.jsx index 2ab0a9080..f2abdf87a 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/settings/ApplicationSettings.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/settings/ApplicationSettings.jsx @@ -12,22 +12,7 @@ class ApplicationSettingsController extends Component { this.initRegSettings = this.initRegSettings.bind(this); this.props.storeApplicationSettings.initRegData(); this.initRegSettings(); - - const valueViewComments = LocalStorage.getBool("sse-mobile-settings-livecomment"); - const valueResolvedComments = LocalStorage.getBool("sse-settings-resolvedcomment"); - const valueUnitMeasurement = LocalStorage.getItem("sse-mobile-settings-unit"); - const valueRefStyle = LocalStorage.getBool('sse-settings-r1c1'); - const valueMacrosMode = LocalStorage.getItem("sse-mobile-macros-mode"); - - if(typeof valueViewComments !== 'undefined') { - this.props.storeApplicationSettings.changeDisplayComments(valueViewComments); - this.props.storeAppOptions.changeCanViewComments(valueViewComments); - } - - typeof valueResolvedComments !== 'undefined' && this.props.storeApplicationSettings.changeDisplayResolved(valueResolvedComments); - typeof valueUnitMeasurement !== 'undefined' && this.props.storeApplicationSettings.changeUnitMeasurement(valueUnitMeasurement); - typeof valueRefStyle !== 'undefined' && this.props.storeApplicationSettings.changeRefStyle(valueRefStyle); - typeof valueMacrosMode !== 'undefined' && this.props.storeApplicationSettings.changeMacrosSettings(valueMacrosMode); + this.props.storeApplicationSettings.changeUnitMeasurement(Common.Utils.Metric.getCurrentMetric()); } initRegSettings() {