[FIX] The unread section is not removed after receiving a new message and swipe to read (#3281)

* Fix unread section from direct messages and thread messages

* Minor tweak

* removed the thread unread, but the thread unread is on branch fix.unread-thread-from-listview

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Reinaldo Neto 2021-08-27 13:33:29 -03:00 committed by GitHub
parent 9bfe0e9912
commit 8b35f5c2b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -178,6 +178,7 @@ class Touchable extends React.Component {
toggleRead = () => {
const { toggleRead, rid, isRead } = this.props;
if (toggleRead) {
toggleRead(rid, isRead);
}

View File

@ -637,6 +637,7 @@ class RoomsListView extends React.Component {
try {
const db = database.active;
const result = await RocketChat.toggleRead(isRead, rid);
if (result.success) {
const subCollection = db.get('subscriptions');
await db.action(async() => {
@ -644,6 +645,7 @@ class RoomsListView extends React.Component {
const subRecord = await subCollection.find(rid);
await subRecord.update((sub) => {
sub.alert = isRead;
sub.unread = 0;
});
} catch (e) {
log(e);