Allow cancelling events whilst they are encrypting (#7483)

pull/21833/head
Michael Telatynski 2022-01-11 15:07:33 +00:00 committed by GitHub
parent 59f57e15fe
commit f620cf9d0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -48,8 +48,8 @@ import EndPollDialog from '../dialogs/EndPollDialog';
import { isPollEnded } from '../messages/MPollBody'; import { isPollEnded } from '../messages/MPollBody';
import { createMapSiteLink } from "../messages/MLocationBody"; import { createMapSiteLink } from "../messages/MLocationBody";
export function canCancel(eventStatus: EventStatus): boolean { export function canCancel(status: EventStatus): boolean {
return eventStatus === EventStatus.QUEUED || eventStatus === EventStatus.NOT_SENT; return status === EventStatus.QUEUED || status === EventStatus.NOT_SENT || status === EventStatus.ENCRYPTING;
} }
export interface IEventTileOps { export interface IEventTileOps {
@ -258,10 +258,6 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
}); });
} }
private getPendingReactions(): MatrixEvent[] {
return this.getReactions(e => canCancel(e.status));
}
private getUnsentReactions(): MatrixEvent[] { private getUnsentReactions(): MatrixEvent[] {
return this.getReactions(e => e.status === EventStatus.NOT_SENT); return this.getReactions(e => e.status === EventStatus.NOT_SENT);
} }