[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:
parent
9bfe0e9912
commit
8b35f5c2b2
|
@ -178,6 +178,7 @@ class Touchable extends React.Component {
|
||||||
|
|
||||||
toggleRead = () => {
|
toggleRead = () => {
|
||||||
const { toggleRead, rid, isRead } = this.props;
|
const { toggleRead, rid, isRead } = this.props;
|
||||||
|
|
||||||
if (toggleRead) {
|
if (toggleRead) {
|
||||||
toggleRead(rid, isRead);
|
toggleRead(rid, isRead);
|
||||||
}
|
}
|
||||||
|
|
|
@ -637,6 +637,7 @@ class RoomsListView extends React.Component {
|
||||||
try {
|
try {
|
||||||
const db = database.active;
|
const db = database.active;
|
||||||
const result = await RocketChat.toggleRead(isRead, rid);
|
const result = await RocketChat.toggleRead(isRead, rid);
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
const subCollection = db.get('subscriptions');
|
const subCollection = db.get('subscriptions');
|
||||||
await db.action(async() => {
|
await db.action(async() => {
|
||||||
|
@ -644,6 +645,7 @@ class RoomsListView extends React.Component {
|
||||||
const subRecord = await subCollection.find(rid);
|
const subRecord = await subCollection.find(rid);
|
||||||
await subRecord.update((sub) => {
|
await subRecord.update((sub) => {
|
||||||
sub.alert = isRead;
|
sub.alert = isRead;
|
||||||
|
sub.unread = 0;
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(e);
|
log(e);
|
||||||
|
|
Loading…
Reference in New Issue