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

This commit is contained in:
Bruno Windels 2019-06-12 11:19:17 +02:00
parent 3836a3e2e2
commit f78aeae83a

View file

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