From 46747c223ad5a72c2324607e07f94b65df6db726 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sun, 7 Mar 2021 23:43:22 +0300 Subject: [PATCH] [DE mobile] fix some stores according to mobx v. 6 --- .../mobile/src/store/applicationSettings.js | 52 ++++++++++++------- .../mobile/src/store/tableSettings.js | 6 ++- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/apps/documenteditor/mobile/src/store/applicationSettings.js b/apps/documenteditor/mobile/src/store/applicationSettings.js index 968c84b78..a1e17a40c 100644 --- a/apps/documenteditor/mobile/src/store/applicationSettings.js +++ b/apps/documenteditor/mobile/src/store/applicationSettings.js @@ -1,45 +1,59 @@ -import {action, observable} from 'mobx'; +import {makeObservable, action, observable} from 'mobx'; export class storeApplicationSettings { - - @observable unitMeasurement = 1; + constructor() { + makeObservable(this, { + unitMeasurement: observable + , isSpellChecking: observable + , isNonprintingCharacters: observable + , isHiddenTableBorders: observable + , isComments: observable + , isResolvedComments: observable + , macrosMode: observable + , changeSpellCheck: action + , changeUnitMeasurement: action + , changeNoCharacters: action + , changeShowTableEmptyLine: action + , changeDisplayComments: action + , changeDisplayResolved: action + , changeMacrosSettings: action + }) + } - @observable isSpellChecking = true; + unitMeasurement = 1; + isSpellChecking = true; + isNonprintingCharacters = false; + isHiddenTableBorders = false; + isComments = true; + isResolvedComments = true; + macrosMode = 0; - @observable isNonprintingCharacters = false; - @observable isHiddenTableBorders = false; - - @observable isComments = true; - @observable isResolvedComments = true; - - @observable macrosMode = 0; - - @action changeUnitMeasurement(value) { + changeUnitMeasurement(value) { this.unitMeasurement = +value; } - @action changeSpellCheck(value) { + changeSpellCheck(value) { this.isSpellChecking = value; } - @action changeNoCharacters(value) { + changeNoCharacters(value) { this.isNonprintingCharacters = value; } - @action changeShowTableEmptyLine(value) { + changeShowTableEmptyLine(value) { this.isHiddenTableBorders = value; } - @action changeDisplayComments(value) { + changeDisplayComments(value) { this.isComments = value; if (!value) this.changeDisplayResolved(value); } - @action changeDisplayResolved(value) { + changeDisplayResolved(value) { this.isResolvedComments = value; } - @action changeMacrosSettings(value) { + changeMacrosSettings(value) { this.macrosMode = +value; } } \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/store/tableSettings.js b/apps/documenteditor/mobile/src/store/tableSettings.js index 440c1f658..7adc88958 100644 --- a/apps/documenteditor/mobile/src/store/tableSettings.js +++ b/apps/documenteditor/mobile/src/store/tableSettings.js @@ -1,7 +1,11 @@ -import {action, observable, computed} from 'mobx'; +import {makeObservable, action, observable, computed} from 'mobx'; import {f7} from 'framework7-react'; export class storeTableSettings { + constructor() { + makeObservable(this) + } + @observable _templates = []; @action initTableTemplates (templates) { this._templates = templates;