From 92f784d8f20cbf05d0a644a9814ce51d25027b83 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 5 Jun 2024 13:27:33 -0300 Subject: [PATCH] feat: Read messages on room close to prevent fetching already seen messages (#5723) --- app/lib/methods/subscriptions/room.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/lib/methods/subscriptions/room.ts b/app/lib/methods/subscriptions/room.ts index d38a84644c..7810258dbc 100644 --- a/app/lib/methods/subscriptions/room.ts +++ b/app/lib/methods/subscriptions/room.ts @@ -74,6 +74,7 @@ export default class RoomSubscription { unsubscribe = async () => { console.log(`[RCRN] Unsubscribing from room ${this.rid}`); + readMessages(this.rid, new Date(), true).catch(e => console.log(e)); this.isAlive = false; reduxStore.dispatch(unsubscribeRoom(this.rid)); if (this.promises) {