You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
also consider pending events when looking for next/prev event to edit
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user