Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Allow cancelling events whilst they are encrypting (#7483)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Jan 11, 2022
1 parent 59f57e1 commit f620cf9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/components/views/context_menus/MessageContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ import EndPollDialog from '../dialogs/EndPollDialog';
import { isPollEnded } from '../messages/MPollBody';
import { createMapSiteLink } from "../messages/MLocationBody";

export function canCancel(eventStatus: EventStatus): boolean {
return eventStatus === EventStatus.QUEUED || eventStatus === EventStatus.NOT_SENT;
export function canCancel(status: EventStatus): boolean {
return status === EventStatus.QUEUED || status === EventStatus.NOT_SENT || status === EventStatus.ENCRYPTING;
}

export interface IEventTileOps {
Expand Down Expand Up @@ -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[] {
return this.getReactions(e => e.status === EventStatus.NOT_SENT);
}
Expand Down

0 comments on commit f620cf9

Please sign in to comment.