PLT-751: Enable arrow to edit posts in comment threads

Этот коммит содержится в:
Florian Orben
2015-10-19 03:01:53 +02:00
родитель d139c9e825
Коммит 58b57acfac
2 изменённых файлов: 34 добавлений и 3 удалений

Просмотреть файл

@@ -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;
}
}
}