Merge pull request #1002 from vincentbavitz/messages-open-groups

Messages open groups
pull/1003/head
Vince 5 years ago committed by GitHub
commit 5c117072ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -187,6 +187,7 @@
} }
await conversation.destroyMessages(); await conversation.destroyMessages();
await window.Signal.Data.removeConversation(id, { await window.Signal.Data.removeConversation(id, {
Conversation: Whisper.Conversation, Conversation: Whisper.Conversation,
}); });

@ -2767,7 +2767,9 @@
window.confirmationDialog({ window.confirmationDialog({
title, title,
message, message,
resolve: () => ConversationController.deleteContact(this.id), resolve: () => {
ConversationController.deleteContact(this.id);
},
}); });
}, },

@ -1116,11 +1116,19 @@ export class Message extends React.PureComponent<Props, State> {
expiring ? 'module-message--expired' : null expiring ? 'module-message--expired' : null
)} )}
role="button" role="button"
onClick={() => { onClick={event => {
const selection = window.getSelection(); const selection = window.getSelection();
// Text is being selected
if (selection && selection.type === 'Range') { if (selection && selection.type === 'Range') {
return; return;
} }
// User clicked on message body
const target = event.target as HTMLDivElement;
if (target.className === 'text-selectable') {
return;
}
this.props.onSelectMessage(); this.props.onSelectMessage();
}} }}
> >

@ -176,9 +176,8 @@ export class SessionClosableOverlay extends React.Component<Props, State> {
value={this.state.groupName} value={this.state.groupName}
maxLength={window.CONSTANTS.MAX_GROUPNAME_LENGTH} maxLength={window.CONSTANTS.MAX_GROUPNAME_LENGTH}
onChange={this.onGroupNameChanged} onChange={this.onGroupNameChanged}
onPressEnter={() => onButtonClick(this.state.groupName)}
/> />
{/* */}
</div> </div>
) : ( ) : (
<SessionIdEditable <SessionIdEditable

@ -61,7 +61,7 @@ export class SessionIdEditable extends React.PureComponent<Props> {
private handleKeyDown(e: any) { private handleKeyDown(e: any) {
const { editable, onPressEnter } = this.props; const { editable, onPressEnter } = this.props;
if (editable && e.keyCode === 13) { if (editable && e.key === 'Enter') {
e.preventDefault(); e.preventDefault();
// tslint:disable-next-line: no-unused-expression // tslint:disable-next-line: no-unused-expression
onPressEnter && onPressEnter(); onPressEnter && onPressEnter();

Loading…
Cancel
Save