From b924cac46aa1c55c5318299e36d0a13f29ef370a Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Thu, 28 Jul 2022 15:55:25 +0300 Subject: [PATCH] [DE PE SSE mobile] Fix Bug 58287 --- apps/documenteditor/mobile/src/controller/Main.jsx | 6 ++++++ .../documenteditor/mobile/src/store/documentInfo.js | 9 +++++++-- .../mobile/src/view/settings/DocumentInfo.jsx | 1 - .../mobile/src/controller/Main.jsx | 10 ++++++++++ .../mobile/src/store/presentationInfo.js | 13 +++++++++---- .../mobile/src/controller/Main.jsx | 12 ++++++++++++ .../mobile/src/store/spreadsheetInfo.js | 7 ++++++- 7 files changed, 50 insertions(+), 8 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index e6fc841e0..ace39414e 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -713,6 +713,12 @@ class MainController extends Component { storeDocumentInfo.changeCount(this.objectInfo); }); + this.api.asc_registerCallback('asc_onMeta', (meta) => { + if(meta) { + storeDocumentInfo.changeTitle(meta.title); + } + }); + // Color Schemes this.api.asc_registerCallback('asc_onSendThemeColorSchemes', (arr) => { diff --git a/apps/documenteditor/mobile/src/store/documentInfo.js b/apps/documenteditor/mobile/src/store/documentInfo.js index d57b4b90c..e79cfdf0d 100644 --- a/apps/documenteditor/mobile/src/store/documentInfo.js +++ b/apps/documenteditor/mobile/src/store/documentInfo.js @@ -8,7 +8,8 @@ export class storeDocumentInfo { dataDoc: observable, switchIsLoaded: action, changeCount: action, - setDataDoc: action + setDataDoc: action, + changeTitle: action }); } @@ -45,4 +46,8 @@ export class storeDocumentInfo { setDataDoc(obj) { this.dataDoc = obj; } -} \ No newline at end of file + + changeTitle(title) { + this.dataDoc.title = title; + } +} diff --git a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx index b414c41cd..be1a4e671 100644 --- a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx +++ b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx @@ -8,7 +8,6 @@ const PageDocumentInfo = (props) => { const _t = t("Settings", { returnObjects: true }); const storeInfo = props.storeDocumentInfo; const fileType = storeInfo.dataDoc.fileType; - const dataApp = props.getAppProps(); const { diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index d37b60bfe..9258c8ab1 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -434,6 +434,16 @@ class MainController extends Component { }); this.api.asc_registerCallback('asc_onReplaceAll', this.onApiTextReplaced.bind(this)); + + // Presentation Info + + const storePresentationInfo = this.props.storePresentationInfo; + + this.api.asc_registerCallback('asc_onMeta', (meta) => { + if(meta) { + storePresentationInfo.changeTitle(meta.title); + } + }); } onApiTextReplaced(found, replaced) { diff --git a/apps/presentationeditor/mobile/src/store/presentationInfo.js b/apps/presentationeditor/mobile/src/store/presentationInfo.js index 29b690525..7acd8c86b 100644 --- a/apps/presentationeditor/mobile/src/store/presentationInfo.js +++ b/apps/presentationeditor/mobile/src/store/presentationInfo.js @@ -2,10 +2,11 @@ import { action, observable, makeObservable } from "mobx"; export class storePresentationInfo { constructor() { - makeObservable(this, { - dataDoc: observable, - setDataDoc: action - }); + makeObservable(this, { + dataDoc: observable, + setDataDoc: action, + changeTitle: action + }); } dataDoc; @@ -13,4 +14,8 @@ export class storePresentationInfo { setDataDoc(obj) { this.dataDoc = obj; } + + changeTitle(title) { + this.dataDoc.title = title; + } } \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index de031d0e1..78c7c4357 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -440,6 +440,18 @@ class MainController extends Component { this.api.asc_registerCallback('asc_onEntriesListMenu', this.onEntriesListMenu.bind(this, false)); this.api.asc_registerCallback('asc_onValidationListMenu', this.onEntriesListMenu.bind(this, true)); + + // Spreadsheet Info + + const storeSpreadsheetInfo = this.props.storeSpreadsheetInfo; + + this.api.asc_registerCallback('asc_onMeta', (meta) => { + if(meta) { + storeSpreadsheetInfo.changeTitle(meta.title); + } + }); + + } onEntriesListMenu(validation, textArr, addArr) { diff --git a/apps/spreadsheeteditor/mobile/src/store/spreadsheetInfo.js b/apps/spreadsheeteditor/mobile/src/store/spreadsheetInfo.js index 406bda2ec..18681f084 100644 --- a/apps/spreadsheeteditor/mobile/src/store/spreadsheetInfo.js +++ b/apps/spreadsheeteditor/mobile/src/store/spreadsheetInfo.js @@ -4,7 +4,8 @@ export class storeSpreadsheetInfo { constructor() { makeObservable(this, { dataDoc: observable, - setDataDoc: action + setDataDoc: action, + changeTitle: action }) } @@ -13,4 +14,8 @@ export class storeSpreadsheetInfo { setDataDoc(obj) { this.dataDoc = obj; } + + changeTitle(title) { + this.dataDoc.title = title; + } } \ No newline at end of file