From 0b62078712190be9edaf8428762185f1c38d5226 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Wed, 28 Jun 2017 02:59:08 +0800 Subject: [PLT-6745] Fix action of SHIFT+UP by fixing latest replay-able post (#6738) * fix latest replayable post * use PostUtils.isSystemMessage instead of checkin that post.type is empty --- webapp/stores/post_store.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'webapp/stores') diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index 66e7108ca..b4c8c43c8 100644 --- a/webapp/stores/post_store.jsx +++ b/webapp/stores/post_store.jsx @@ -8,6 +8,7 @@ import ChannelStore from 'stores/channel_store.jsx'; import BrowserStore from 'stores/browser_store.jsx'; import UserStore from 'stores/user_store.jsx'; +import * as PostUtils from 'utils/post_utils.jsx'; import {Constants} from 'utils/constants.jsx'; const ActionTypes = Constants.ActionTypes; @@ -69,13 +70,13 @@ class PostStoreClass extends EventEmitter { return postsInChannel[0]; } - getLatestNonEphemeralPost(channelId) { + getLatestReplyablePost(channelId) { const postIds = getState().entities.posts.postsInChannel[channelId]; const posts = getState().entities.posts.posts; for (const postId of postIds) { const post = posts[postId] || {}; - if (post.state !== Constants.POST_DELETED && post.type !== Constants.PostTypes.EPHEMERAL) { + if (post.state !== Constants.POST_DELETED && !PostUtils.isSystemMessage(post)) { return post; } } -- cgit v1.2.3-1-g7c22