You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-11 19:37:30 +03:00
prevent earlier replacements from messing things up
This commit is contained in:
@@ -758,6 +758,10 @@ utils.extend(module.exports.MatrixEvent.prototype, {
|
|||||||
if (this.isRedacted()) {
|
if (this.isRedacted()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// ignore previous replacements
|
||||||
|
if (this._replacingEvent && this._replacingEvent.getTs() > newEvent.getTs()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (newEvent.isBeingDecrypted()) {
|
if (newEvent.isBeingDecrypted()) {
|
||||||
throw new Error("Trying to replace event when " +
|
throw new Error("Trying to replace event when " +
|
||||||
"new content hasn't been decrypted yet");
|
"new content hasn't been decrypted yet");
|
||||||
|
|||||||
Reference in New Issue
Block a user