[FIX] Unread bar in channel flash quickly and then disappear (#22275)

Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>

Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>
Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
pull/22291/head
Douglas Fabris 4 years ago committed by GitHub
parent d733dd76b2
commit 3decfd7c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      app/ui-utils/client/lib/readMessages.js

@ -109,8 +109,7 @@ export const readMessage = new class extends Emitter {
} }
if (!subscription.alert && (subscription.unread === 0)) { if (!subscription.alert && (subscription.unread === 0)) {
const roomDom = $(room.dom); $('.message.first-unread').removeClass('first-unread');
roomDom.find('.message.first-unread').removeClass('first-unread');
room.unreadSince.set(undefined); room.unreadSince.set(undefined);
return; return;
} }
@ -153,9 +152,8 @@ export const readMessage = new class extends Emitter {
if (firstUnreadRecord) { if (firstUnreadRecord) {
room.unreadFirstId = firstUnreadRecord._id; room.unreadFirstId = firstUnreadRecord._id;
const roomDom = $(room.dom); $('.message.first-unread').removeClass('first-unread');
roomDom.find('.message.first-unread').removeClass('first-unread'); $(`.message#${ firstUnreadRecord._id }`).addClass('first-unread');
roomDom.find(`.message#${ firstUnreadRecord._id }`).addClass('first-unread');
} }
} }
}(); }();

Loading…
Cancel
Save