summaryrefslogtreecommitdiffstats
path: root/web/react/stores/post_store.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2015-10-21 11:27:27 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2015-10-21 11:27:27 -0400
commita4e6cce98eb0c04deaa929ccd28b266e312c0ca1 (patch)
tree0e197ab40b97e5f81f1c07a9f53b69bb744375d7 /web/react/stores/post_store.jsx
parent7ea8268ae88ecd3b94c0bf9bafbc169c50df4595 (diff)
parent27c2862c56296b982031c71f8a89163b77630392 (diff)
downloadchat-a4e6cce98eb0c04deaa929ccd28b266e312c0ca1.tar.gz
chat-a4e6cce98eb0c04deaa929ccd28b266e312c0ca1.tar.bz2
chat-a4e6cce98eb0c04deaa929ccd28b266e312c0ca1.zip
Merge pull request #1103 from florianorben/PLT-751
PLT-751: Enable arrow to edit posts in comment threads
Diffstat (limited to 'web/react/stores/post_store.jsx')
-rw-r--r--web/react/stores/post_store.jsx13
1 files changed, 10 insertions, 3 deletions
diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx
index 8609d8bbf..0ace956d2 100644
--- a/web/react/stores/post_store.jsx
+++ b/web/react/stores/post_store.jsx
@@ -230,7 +230,7 @@ class PostStoreClass extends EventEmitter {
getPosts(channelId) {
return BrowserStore.getItem('posts_' + channelId);
}
- getCurrentUsersLatestPost(channelId) {
+ getCurrentUsersLatestPost(channelId, rootId) {
const userId = UserStore.getCurrentId();
var postList = makePostListNonNull(this.getPosts(channelId));
var i = 0;
@@ -239,8 +239,15 @@ class PostStoreClass extends EventEmitter {
for (i; i < len; i++) {
if (postList.posts[postList.order[i]].user_id === userId) {
- lastPost = postList.posts[postList.order[i]];
- break;
+ if (rootId) {
+ if (postList.posts[postList.order[i]].root_id === rootId || postList.posts[postList.order[i]].id === rootId) {
+ lastPost = postList.posts[postList.order[i]];
+ break;
+ }
+ } else {
+ lastPost = postList.posts[postList.order[i]];
+ break;
+ }
}
}