diff --git a/js/conversation_controller.js b/js/conversation_controller.js index 5e102420d..171703716 100644 --- a/js/conversation_controller.js +++ b/js/conversation_controller.js @@ -187,6 +187,7 @@ } await conversation.destroyMessages(); + await window.Signal.Data.removeConversation(id, { Conversation: Whisper.Conversation, }); diff --git a/js/models/conversations.js b/js/models/conversations.js index fac026b1a..0029e8f14 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -2767,7 +2767,9 @@ window.confirmationDialog({ title, message, - resolve: () => ConversationController.deleteContact(this.id), + resolve: () => { + ConversationController.deleteContact(this.id); + }, }); }, diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index c8dd2a98d..99f1b3d97 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -1116,11 +1116,19 @@ export class Message extends React.PureComponent { expiring ? 'module-message--expired' : null )} role="button" - onClick={() => { + onClick={event => { const selection = window.getSelection(); + // Text is being selected if (selection && selection.type === 'Range') { return; } + + // User clicked on message body + const target = event.target as HTMLDivElement; + if (target.className === 'text-selectable') { + return; + } + this.props.onSelectMessage(); }} > diff --git a/ts/components/session/SessionClosableOverlay.tsx b/ts/components/session/SessionClosableOverlay.tsx index de9119337..e86ed1ef0 100644 --- a/ts/components/session/SessionClosableOverlay.tsx +++ b/ts/components/session/SessionClosableOverlay.tsx @@ -176,9 +176,8 @@ export class SessionClosableOverlay extends React.Component { value={this.state.groupName} maxLength={window.CONSTANTS.MAX_GROUPNAME_LENGTH} onChange={this.onGroupNameChanged} + onPressEnter={() => onButtonClick(this.state.groupName)} /> - - {/* */} ) : ( { private handleKeyDown(e: any) { const { editable, onPressEnter } = this.props; - if (editable && e.keyCode === 13) { + if (editable && e.key === 'Enter') { e.preventDefault(); // tslint:disable-next-line: no-unused-expression onPressEnter && onPressEnter();