diff options
author | David Lu <david.lu97@outlook.com> | 2016-10-11 09:06:12 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-10-11 09:06:12 -0400 |
commit | 78a4b19fd7094b3b00fad1ee47d89e6e4e3cdb99 (patch) | |
tree | f46499a14962fd588d79243c8cdb6cc568c0d90e /webapp/actions/post_actions.jsx | |
parent | ae79fabf4bc40aed4777dc847fbe2719df0bb508 (diff) | |
download | chat-78a4b19fd7094b3b00fad1ee47d89e6e4e3cdb99.tar.gz chat-78a4b19fd7094b3b00fad1ee47d89e6e4e3cdb99.tar.bz2 chat-78a4b19fd7094b3b00fad1ee47d89e6e4e3cdb99.zip |
PLT-3785 Re-enabled marking messages unread (#4179)
* Re-added ALT+Click to mark msgs unread, fixed mentions for DM
* Added string to /shortcuts
Diffstat (limited to 'webapp/actions/post_actions.jsx')
-rw-r--r-- | webapp/actions/post_actions.jsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx index 938770c50..63e3feec5 100644 --- a/webapp/actions/post_actions.jsx +++ b/webapp/actions/post_actions.jsx @@ -73,6 +73,7 @@ export function setUnreadPost(channelId, postId) { let ownNewMessage = false; const post = PostStore.getPost(channelId, postId); const posts = PostStore.getVisiblePosts(channelId).posts; + const currentChannel = ChannelStore.getCurrent(); var currentUsedId = UserStore.getCurrentId(); if (currentUsedId === post.user_id || PostUtils.isSystemMessage(post)) { for (const otherPostId in posts) { @@ -103,6 +104,12 @@ export function setUnreadPost(channelId, postId) { unreadPosts += 1; } } + + // Temporary workaround for DM channels having wrong unread values + if (currentChannel.type === Constants.DM_CHANNEL) { + unreadPosts = 0; + } + const member = ChannelStore.getMember(channelId); const channel = ChannelStore.get(channelId); member.last_viewed_at = lastViewed; |