From 837a3374e2d8e30d3722b8782d57145b95e4cd8a Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Thu, 12 Nov 2020 04:50:30 +0200 Subject: [PATCH] Fix selection context menu rights --- src/components/chat/contextMenu.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/chat/contextMenu.ts b/src/components/chat/contextMenu.ts index 06f55498..1231e9de 100644 --- a/src/components/chat/contextMenu.ts +++ b/src/components/chat/contextMenu.ts @@ -59,7 +59,7 @@ export default class ChatContextMenu { this.buttons.forEach(button => { let good: boolean; - if(appImManager.chatSelection.isSelecting && !button.withSelection) { + if((appImManager.chatSelection.isSelecting && !button.withSelection) || (button.withSelection && !appImManager.chatSelection.isSelecting)) { good = false; } else { good = bubbleContainer || isTouchSupported ? @@ -171,7 +171,7 @@ export default class ChatContextMenu { icon: 'forward', text: 'Forward selected', onClick: this.onForwardClick, - verify: () => appImManager.chatSelection.selectedMids.has(this.msgID), + verify: () => !appImManager.chatSelection.selectionForwardBtn.hasAttribute('disabled') && appImManager.chatSelection.selectedMids.has(this.msgID), notDirect: () => appImManager.chatSelection.selectedMids.has(this.msgID), withSelection: true }, { @@ -200,7 +200,7 @@ export default class ChatContextMenu { icon: 'delete danger', text: 'Delete selected', onClick: this.onDeleteClick, - verify: () => appImManager.chatSelection.selectedMids.has(this.msgID), + verify: () => !appImManager.chatSelection.selectionDeleteBtn.hasAttribute('disabled') && appImManager.chatSelection.selectedMids.has(this.msgID), notDirect: () => appImManager.chatSelection.selectedMids.has(this.msgID), withSelection: true }];