also consider pending events when looking for next/prev event to edit

pull/21833/head
Bruno Windels 2019-06-12 11:19:17 +02:00
parent 3836a3e2e2
commit f78aeae83a
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ export function canEditOwnEvent(mxEvent) {
const MAX_JUMP_DISTANCE = 100; const MAX_JUMP_DISTANCE = 100;
export function findEditableEvent(room, isForward, fromEventId = undefined) { export function findEditableEvent(room, isForward, fromEventId = undefined) {
const liveTimeline = room.getLiveTimeline(); const liveTimeline = room.getLiveTimeline();
const events = liveTimeline.getEvents(); const events = liveTimeline.getEvents().concat(room.getPendingEvents());
const maxIdx = events.length - 1; const maxIdx = events.length - 1;
const inc = isForward ? 1 : -1; const inc = isForward ? 1 : -1;
const beginIdx = isForward ? 0 : maxIdx; const beginIdx = isForward ? 0 : maxIdx;