PLT-3785 Re-enabled marking messages unread (#4179)
* Re-added ALT+Click to mark msgs unread, fixed mentions for DM * Added string to /shortcuts
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
ae79fabf4b
Коммит
78a4b19fd7
@@ -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;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import PostHeader from './post_header.jsx';
|
||||
import PostBody from './post_body.jsx';
|
||||
import ProfilePicture from 'components/profile_picture.jsx';
|
||||
import * as PostActions from 'actions/post_actions.jsx';
|
||||
|
||||
import Constants from 'utils/constants.jsx';
|
||||
const ActionTypes = Constants.ActionTypes;
|
||||
@@ -49,13 +50,11 @@ export default class Post extends React.Component {
|
||||
this.refs.info.forceUpdate();
|
||||
this.refs.header.forceUpdate();
|
||||
}
|
||||
handlePostClick() {
|
||||
/* Disabled do to a bug: https://mattermost.atlassian.net/browse/PLT-3785
|
||||
handlePostClick(e) {
|
||||
if (e.altKey) {
|
||||
e.preventDefault();
|
||||
PostActions.setUnreadPost(this.props.post.channel_id, this.props.post.id);
|
||||
}
|
||||
*/
|
||||
}
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) {
|
||||
|
||||
@@ -328,8 +328,9 @@ class ChannelStoreClass extends EventEmitter {
|
||||
let chMentionCount = chMember.mention_count;
|
||||
let chUnreadCount = ch.total_msg_count - chMember.msg_count;
|
||||
|
||||
// Temporary workaround for DM channels having wrong unread values
|
||||
if (ch.type === 'D') {
|
||||
chMentionCount = chUnreadCount;
|
||||
chMentionCount = 0;
|
||||
} else if (chMember.notify_props && chMember.notify_props.mark_unread === NotificationPrefs.MENTION) {
|
||||
chUnreadCount = 0;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user