From f620cf9d0e6ab39b2108ec92800eff550cf165c6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 11 Jan 2022 15:07:33 +0000 Subject: [PATCH] Allow cancelling events whilst they are encrypting (#7483) --- src/components/views/context_menus/MessageContextMenu.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.tsx b/src/components/views/context_menus/MessageContextMenu.tsx index a856853ff7..e6dd95d189 100644 --- a/src/components/views/context_menus/MessageContextMenu.tsx +++ b/src/components/views/context_menus/MessageContextMenu.tsx @@ -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 { @@ -258,10 +258,6 @@ export default class MessageContextMenu extends React.Component }); } - private getPendingReactions(): MatrixEvent[] { - return this.getReactions(e => canCancel(e.status)); - } - private getUnsentReactions(): MatrixEvent[] { return this.getReactions(e => e.status === EventStatus.NOT_SENT); }