From ca63e937d396387254c91d225735b288cc2c6701 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 5 Mar 2021 10:56:13 -0700 Subject: [PATCH] Fix up logic to show sent receipts correctly --- src/components/structures/MessagePanel.js | 10 ++++++++ src/components/views/rooms/EventTile.js | 29 +++++++++++++---------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 161227a139..dab1c953a9 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -595,6 +595,15 @@ export default class MessagePanel extends React.Component { const readReceipts = this._readReceiptsByEvent[eventId]; + let isLastSuccessful = false; + const isSentState = s => !s || s === 'sent'; + const isSent = isSentState(mxEv.getAssociatedStatus()) + if (!nextEvent && isSent) { + isLastSuccessful = true; + } else if (nextEvent && isSent && !isSentState(nextEvent.getAssociatedStatus())) { + isLastSuccessful = true; + } + // use txnId as key if available so that we don't remount during sending ret.push(
  • u !== myUserId); - return !hasBeenRead; + if (receipts.some(r => r.userId !== myUserId)) return false; + + // Finally, we should show a receipt. + return true; } get _shouldShowSendingReceipt() {