1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

Fix timeline jumpiness by setting correct txnId

This commit is contained in:
Germain Souquet
2021-04-12 09:37:19 +01:00
parent 837764190f
commit 79aefe9707

View File

@@ -195,9 +195,10 @@ export function Room(roomId, client, myUserId, opts) {
if (serializedPendingEventList) {
JSON.parse(serializedPendingEventList)
.forEach(serializedEvent => {
const txnId = client.makeTxnId();
const event = new MatrixEvent(serializedEvent);
event.setStatus(EventStatus.NOT_SENT);
const txnId = client.makeTxnId();
event.setTxnId(txnId);
this.addPendingEvent(event, txnId);
});
}
@@ -1472,9 +1473,6 @@ Room.prototype.updatePendingEvent = function(event, newStatus, newEventId) {
for (let i = 0; i < this._timelineSets.length; i++) {
this._timelineSets[i].replaceEventId(oldEventId, newEventId);
}
if (this._opts.pendingEventOrdering === "detached") {
this.removePendingEvent(event.event.event_id);
}
} else if (newStatus == EventStatus.CANCELLED) {
// remove it from the pending event list, or the timeline.
if (this._pendingEventList) {