From ce9c49beaf7ca482099460d9e8d5f07fb4e61cf6 Mon Sep 17 00:00:00 2001 From: ShimaginAndrey Date: Wed, 7 Jul 2021 18:31:44 +0300 Subject: [PATCH] [DE PE SSE] Fix resolved and sort comments --- apps/common/mobile/lib/controller/collaboration/Comments.jsx | 5 +++-- apps/common/mobile/lib/view/collaboration/Comments.jsx | 2 +- apps/documenteditor/mobile/src/store/applicationSettings.js | 2 ++ .../mobile/src/store/applicationSettings.js | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/common/mobile/lib/controller/collaboration/Comments.jsx b/apps/common/mobile/lib/controller/collaboration/Comments.jsx index 068fa8d75f..fa00c14f51 100644 --- a/apps/common/mobile/lib/controller/collaboration/Comments.jsx +++ b/apps/common/mobile/lib/controller/collaboration/Comments.jsx @@ -77,7 +77,7 @@ class CommentsController extends Component { const api = Common.EditorApi.get(); /** coauthoring begin **/ const isLiveCommenting = LocalStorage.getBool(`${window.editorType}-mobile-settings-livecomment`, true); - const resolved = LocalStorage.getBool(`${window.editorType}-settings-resolvedcomment`, true); + const resolved = LocalStorage.getBool(`${window.editorType}-settings-resolvedcomment`); this.storeApplicationSettings.changeDisplayComments(isLiveCommenting); this.storeApplicationSettings.changeDisplayResolved(resolved); isLiveCommenting ? api.asc_showComments(resolved) : api.asc_hideComments(); @@ -494,9 +494,10 @@ class ViewCommentsController extends Component { }); } const api = Common.EditorApi.get(); + api.asc_showComments(this.props.storeApplicationSettings.isResolvedComments); api.asc_changeComment(comment.uid, ascComment); - if(!this.props.storeApplicationSettings.isResolvedComments) { + if(this.props.storeApplicationSettings.isResolvedComments) { this.closeViewCurComments(); } } diff --git a/apps/common/mobile/lib/view/collaboration/Comments.jsx b/apps/common/mobile/lib/view/collaboration/Comments.jsx index 89975b234b..cde91a273d 100644 --- a/apps/common/mobile/lib/view/collaboration/Comments.jsx +++ b/apps/common/mobile/lib/view/collaboration/Comments.jsx @@ -633,7 +633,7 @@ const ViewComments = ({storeComments, storeAppOptions, onCommentMenuClick, onRes const viewMode = !storeAppOptions.canComments; const comments = storeComments.groupCollectionFilter || storeComments.collectionComments; - const sortComments = comments.length > 0 ? [...comments].sort((a, b) => a.time > b.time ? 1 : -1) : null; + const sortComments = comments.length > 0 ? [...comments].sort((a, b) => a.time > b.time ? -1 : 1) : null; const [clickComment, setComment] = useState(); const [commentActionsOpened, openActionComment] = useState(false); diff --git a/apps/documenteditor/mobile/src/store/applicationSettings.js b/apps/documenteditor/mobile/src/store/applicationSettings.js index 0cc34353f5..df4c5f71bf 100644 --- a/apps/documenteditor/mobile/src/store/applicationSettings.js +++ b/apps/documenteditor/mobile/src/store/applicationSettings.js @@ -51,6 +51,8 @@ export class storeApplicationSettings { } changeDisplayResolved(value) { + const api = Common.EditorApi.get(); + api.asc_showComments(value); this.isResolvedComments = value; } diff --git a/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js b/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js index 558d872301..c0967025d6 100644 --- a/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js +++ b/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js @@ -108,6 +108,8 @@ export class storeApplicationSettings { } changeDisplayResolved(value) { + const api = Common.EditorApi.get(); + api.asc_showComments(value); this.isResolvedComments = value; }