Merge pull request #2148 from mattermost/missing-posts-2.0
RC2 PLT-1774 Fixing the elusive missing post bug
Этот коммит содержится в:
@@ -83,8 +83,6 @@ class PostStoreClass extends EventEmitter {
|
||||
this.getCommentDraft = this.getCommentDraft.bind(this);
|
||||
this.clearDraftUploads = this.clearDraftUploads.bind(this);
|
||||
this.clearCommentDraftUploads = this.clearCommentDraftUploads.bind(this);
|
||||
this.storeLatestUpdate = this.storeLatestUpdate.bind(this);
|
||||
this.getLatestUpdate = this.getLatestUpdate.bind(this);
|
||||
this.getCurrentUsersLatestPost = this.getCurrentUsersLatestPost.bind(this);
|
||||
this.getCommentCount = this.getCommentCount.bind(this);
|
||||
|
||||
@@ -258,7 +256,7 @@ class PostStoreClass extends EventEmitter {
|
||||
const np = newPosts.posts[pid];
|
||||
if (np.delete_at === 0) {
|
||||
combinedPosts.posts[pid] = np;
|
||||
if (combinedPosts.order.indexOf(pid) === -1) {
|
||||
if (combinedPosts.order.indexOf(pid) === -1 && newPosts.order.indexOf(pid) !== -1) {
|
||||
combinedPosts.order.push(pid);
|
||||
}
|
||||
}
|
||||
@@ -507,19 +505,6 @@ class PostStoreClass extends EventEmitter {
|
||||
}
|
||||
});
|
||||
}
|
||||
storeLatestUpdate(channelId, time) {
|
||||
if (!this.postsInfo.hasOwnProperty(channelId)) {
|
||||
this.postsInfo[channelId] = {};
|
||||
}
|
||||
this.postsInfo[channelId].latestPost = time;
|
||||
}
|
||||
getLatestUpdate(channelId) {
|
||||
if (this.postsInfo.hasOwnProperty(channelId) && this.postsInfo[channelId].hasOwnProperty('latestPost')) {
|
||||
return this.postsInfo[channelId].latestPost;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
getCommentCount(post) {
|
||||
const posts = this.getAllPosts(post.channel_id).posts;
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user