diff --git a/web/src/ui/timeline/content/EncryptedBody.tsx b/web/src/ui/timeline/content/EncryptedBody.tsx index 4906043..70e611d 100644 --- a/web/src/ui/timeline/content/EncryptedBody.tsx +++ b/web/src/ui/timeline/content/EncryptedBody.tsx @@ -17,9 +17,12 @@ import EventContentProps from "./props.ts" import LockIcon from "../../../icons/lock.svg?react" import LockClockIcon from "../../../icons/lock.svg?react" +const unknownSessionErrorPrefix = "failed to decrypt megolm event: no session with given ID found" + const EncryptedBody = ({ event }: EventContentProps) => { - if (event.decryption_error) { - return
Failed to decrypt: {event.decryption_error}
+ const decryptionError = event.last_edit?.decryption_error ?? event.decryption_error + if (decryptionError && !decryptionError.startsWith(unknownSessionErrorPrefix)) { + return
Failed to decrypt: {decryptionError}
} return
Waiting for message
}