[DE PE SSE] Fix resolved and sort comments
This commit is contained in:
parent
58e8be1904
commit
ce9c49beaf
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -51,6 +51,8 @@ export class storeApplicationSettings {
|
|||
}
|
||||
|
||||
changeDisplayResolved(value) {
|
||||
const api = Common.EditorApi.get();
|
||||
api.asc_showComments(value);
|
||||
this.isResolvedComments = value;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,8 @@ export class storeApplicationSettings {
|
|||
}
|
||||
|
||||
changeDisplayResolved(value) {
|
||||
const api = Common.EditorApi.get();
|
||||
api.asc_showComments(value);
|
||||
this.isResolvedComments = value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue