Unverified Commit a1297d0e authored by Diego Mello's avatar Diego Mello Committed by GitHub
Browse files

[FIX] Update last open on message stream received (#1240)

parent dc08dec5
......@@ -88,6 +88,7 @@ export default function subscribeRoom({ rid }) {
const handleMessageReceived = protectedFunction((ddpMessage) => {
const message = buildMessage(EJSON.fromJSONValue(ddpMessage.fields.args[0]));
const lastOpen = new Date();
if (rid !== message.rid) {
return;
}
......@@ -163,7 +164,7 @@ export default function subscribeRoom({ rid }) {
try {
await subCollection.find(rid);
this.readMessages(rid);
this.readMessages(rid, lastOpen);
} catch (e) {
console.log('Subscription not found. We probably subscribed to a not joined channel. No need to mark as read.');
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment