From 0636544c40c38d712dfbc134c2511a8a3d4335be Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 11 Feb 2022 19:28:18 +0100 Subject: [PATCH] components/app: close notifications when receiving READ message --- components/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/app.js b/components/app.js index 034a46a..72217d3 100644 --- a/components/app.js +++ b/components/app.js @@ -1022,6 +1022,14 @@ export default class App extends Component { server: client.params, receipts: { [ReceiptType.READ]: readReceipt }, }); + for (let notif of this.messageNotifications) { + if (client.cm(notif.data.bufferName) !== client.cm(target)) { + continue; + } + if (isMessageBeforeReceipt(notif.data.message, readReceipt)) { + notif.close(); + } + } this.setBufferState({ server: serverID, name: target }, (buf) => { if (buf.prevReadReceipt && buf.prevReadReceipt.time >= readReceipt.time) { return;