PLT-4189 always highlight reply mentions (#4443)

Этот коммит содержится в:
enahum
2016-11-04 13:05:19 -03:00
коммит произвёл GitHub
родитель 1b5e21eaaa
Коммит 6289c72686

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

@@ -264,7 +264,6 @@ export default class PostList extends React.Component {
let commentCount = 0;
let isCommentMention = false;
let lastCommentOnThreadTime = Number.MAX_SAFE_INTEGER;
let commentRootId;
if (parentPost) {
commentRootId = post.root_id;
@@ -275,18 +274,14 @@ export default class PostList extends React.Component {
for (const postId in posts) {
if (posts[postId].root_id === commentRootId) {
commentCount += 1;
if (posts[postId].user_id === userId && (lastCommentOnThreadTime === Number.MAX_SAFE_INTEGER || lastCommentOnThreadTime < posts[postId].create_at)) {
lastCommentOnThreadTime = posts[postId].create_at;
}
}
}
if (parentPost && commentRootId) {
const commentsNotifyLevel = this.props.currentUser.notify_props.comments || 'never';
const notCurrentUser = post.user_id !== userId || (post.props && post.props.from_webhook);
const notViewed = this.props.lastViewed !== 0 && post.create_at > this.props.lastViewed;
if (notCurrentUser && notViewed) {
if (commentsNotifyLevel === 'any' && (posts[commentRootId].user_id === userId || post.create_at > lastCommentOnThreadTime)) {
if (notCurrentUser) {
if (commentsNotifyLevel === 'any') {
isCommentMention = true;
} else if (commentsNotifyLevel === 'root' && posts[commentRootId].user_id === userId) {
isCommentMention = true;