Merge pull request #1533 from hmhealey/plt1290
PLT-1290 Fix up arrow to edit posts
Этот коммит содержится в:
@@ -39,6 +39,7 @@ class PostStoreClass extends EventEmitter {
|
|||||||
|
|
||||||
this.makePostsInfo = this.makePostsInfo.bind(this);
|
this.makePostsInfo = this.makePostsInfo.bind(this);
|
||||||
|
|
||||||
|
this.getPost = this.getPost.bind(this);
|
||||||
this.getAllPosts = this.getAllPosts.bind(this);
|
this.getAllPosts = this.getAllPosts.bind(this);
|
||||||
this.getEarliestPost = this.getEarliestPost.bind(this);
|
this.getEarliestPost = this.getEarliestPost.bind(this);
|
||||||
this.getLatestPost = this.getLatestPost.bind(this);
|
this.getLatestPost = this.getLatestPost.bind(this);
|
||||||
@@ -160,6 +161,17 @@ class PostStoreClass extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPost(channelId, postId) {
|
||||||
|
const posts = this.postsInfo[channelId].postList;
|
||||||
|
let post = null;
|
||||||
|
|
||||||
|
if (posts.posts.hasOwnProperty(postId)) {
|
||||||
|
post = Object.assign({}, posts.posts[postId]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return post;
|
||||||
|
}
|
||||||
|
|
||||||
getAllPosts(id) {
|
getAllPosts(id) {
|
||||||
if (this.postsInfo.hasOwnProperty(id)) {
|
if (this.postsInfo.hasOwnProperty(id)) {
|
||||||
return Object.assign({}, this.postsInfo[id].postList);
|
return Object.assign({}, this.postsInfo[id].postList);
|
||||||
@@ -554,7 +566,7 @@ class PostStoreClass extends EventEmitter {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
getCommentCount(post) {
|
getCommentCount(post) {
|
||||||
const posts = this.getPosts(post.channel_id).posts;
|
const posts = this.getAllPosts(post.channel_id).posts;
|
||||||
|
|
||||||
let commentCount = 0;
|
let commentCount = 0;
|
||||||
for (const id in posts) {
|
for (const id in posts) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user