You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
Fixup: dont assume there is a prior edit
This commit is contained in:
@@ -206,7 +206,7 @@ export default class MessageEditor extends React.Component {
|
|||||||
_cancelPreviousPendingEdit() {
|
_cancelPreviousPendingEdit() {
|
||||||
const originalEvent = this.props.editState.getEvent();
|
const originalEvent = this.props.editState.getEvent();
|
||||||
const previousEdit = originalEvent.replacingEvent();
|
const previousEdit = originalEvent.replacingEvent();
|
||||||
if (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT) {
|
if (previousEdit && (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT)) {
|
||||||
this.context.matrixClient.cancelPendingEvent(previousEdit);
|
this.context.matrixClient.cancelPendingEvent(previousEdit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user