[DE PE SSE] Fix resolved and sort comments

This commit is contained in:
ShimaginAndrey 2021-07-07 18:31:44 +03:00
parent 58e8be1904
commit ce9c49beaf
4 changed files with 8 additions and 3 deletions

View file

@ -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();
}
}

View file

@ -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);

View file

@ -51,6 +51,8 @@ export class storeApplicationSettings {
}
changeDisplayResolved(value) {
const api = Common.EditorApi.get();
api.asc_showComments(value);
this.isResolvedComments = value;
}

View file

@ -108,6 +108,8 @@ export class storeApplicationSettings {
}
changeDisplayResolved(value) {
const api = Common.EditorApi.get();
api.asc_showComments(value);
this.isResolvedComments = value;
}