diff --git a/app/presentation/RoomItem/Touchable.js b/app/presentation/RoomItem/Touchable.js index bbf7cbf86..52f2c094f 100644 --- a/app/presentation/RoomItem/Touchable.js +++ b/app/presentation/RoomItem/Touchable.js @@ -178,6 +178,7 @@ class Touchable extends React.Component { toggleRead = () => { const { toggleRead, rid, isRead } = this.props; + if (toggleRead) { toggleRead(rid, isRead); } diff --git a/app/views/RoomsListView/index.js b/app/views/RoomsListView/index.js index 214f213e4..8b905fb25 100644 --- a/app/views/RoomsListView/index.js +++ b/app/views/RoomsListView/index.js @@ -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);