diff options
author | Florian Orben <florian.orben@gmail.com> | 2015-10-19 03:01:53 +0200 |
---|---|---|
committer | Florian Orben <florian.orben@gmail.com> | 2015-10-19 21:04:09 +0200 |
commit | 58b57acfacbae4aa4af0688ad89ba2f6c7d100ef (patch) | |
tree | 4a4c995b9e8ee0454e067104cf00bf8e22deef92 /web/react/stores | |
parent | d139c9e825d0149329d90684ebe2d6b31a728b16 (diff) | |
download | chat-58b57acfacbae4aa4af0688ad89ba2f6c7d100ef.tar.gz chat-58b57acfacbae4aa4af0688ad89ba2f6c7d100ef.tar.bz2 chat-58b57acfacbae4aa4af0688ad89ba2f6c7d100ef.zip |
PLT-751: Enable arrow to edit posts in comment threads
Diffstat (limited to 'web/react/stores')
-rw-r--r-- | web/react/stores/post_store.jsx | 13 |
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..90adc408d 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) { + lastPost = postList.posts[postList.order[i]]; + break; + } + } else { + lastPost = postList.posts[postList.order[i]]; + break; + } } } |