PLT-3221 Remove async call to get posts when creating a comment and editing a post (#3300)
PLT-3203 Commenting on the RHS while in permalink view makes the message not show up in the RHS
Этот коммит содержится в:
@@ -231,13 +231,14 @@ class PostStoreClass extends EventEmitter {
|
||||
this.postsInfo[post.channel_id].postList = postList;
|
||||
}
|
||||
|
||||
storeFocusedPost(postId, postList) {
|
||||
storeFocusedPost(postId, channelId, postList) {
|
||||
const focusedPost = postList.posts[postId];
|
||||
if (!focusedPost) {
|
||||
return;
|
||||
}
|
||||
this.currentFocusedPostId = postId;
|
||||
this.storePosts(postId, postList);
|
||||
this.storePosts(channelId, postList);
|
||||
}
|
||||
|
||||
checkBounds(id, numRequested, postList, before) {
|
||||
@@ -407,11 +408,11 @@ class PostStoreClass extends EventEmitter {
|
||||
return null;
|
||||
}
|
||||
|
||||
let posts;
|
||||
const posts = {};
|
||||
let pendingPosts;
|
||||
for (const k in this.postsInfo) {
|
||||
if (this.postsInfo[k].postList && this.postsInfo[k].postList.posts.hasOwnProperty(this.selectedPostId)) {
|
||||
posts = this.postsInfo[k].postList.posts;
|
||||
Object.assign(posts, this.postsInfo[k].postList.posts);
|
||||
if (this.postsInfo[k].pendingPosts != null) {
|
||||
pendingPosts = this.postsInfo[k].pendingPosts.posts;
|
||||
}
|
||||
@@ -559,7 +560,7 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => {
|
||||
}
|
||||
case ActionTypes.RECEIVED_FOCUSED_POST:
|
||||
PostStore.clearChannelVisibility(action.postId, false);
|
||||
PostStore.storeFocusedPost(action.postId, makePostListNonNull(action.post_list));
|
||||
PostStore.storeFocusedPost(action.postId, action.channelId, makePostListNonNull(action.post_list));
|
||||
PostStore.emitChange();
|
||||
break;
|
||||
case ActionTypes.RECEIVED_POST:
|
||||
@@ -579,6 +580,10 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => {
|
||||
PostStore.storeDraft(action.post.channel_id, null);
|
||||
PostStore.jumpPostsViewToBottom();
|
||||
break;
|
||||
case ActionTypes.CREATE_COMMENT:
|
||||
PostStore.storePendingPost(action.post);
|
||||
PostStore.storeCommentDraft(action.post.root_id, null);
|
||||
break;
|
||||
case ActionTypes.POST_DELETED:
|
||||
PostStore.deletePost(action.post);
|
||||
PostStore.emitChange();
|
||||
|
||||
Ссылка в новой задаче
Block a user