From 4cdc2f8a910e29060307b9494abdf504218a4b2e Mon Sep 17 00:00:00 2001 From: Noelia Date: Tue, 15 Nov 2022 15:17:58 +0100 Subject: [PATCH] fix(CreateChat): Text input is displayed when choosing contacts for new chat Applied the following solution agreed with design team: When a user types their message, hitting enter, or pressing send, should automatically create the chat and send the message, removing the 'To' input field and Confirm/Reject buttons (that means, directly navigating to the new created chat). Fixes #7706 --- .../Chat/panels/InlineSelectorPanel.qml | 2 +- .../AppLayouts/Chat/views/CreateChatView.qml | 34 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ui/app/AppLayouts/Chat/panels/InlineSelectorPanel.qml b/ui/app/AppLayouts/Chat/panels/InlineSelectorPanel.qml index d66ad10e81..844f56ffd1 100644 --- a/ui/app/AppLayouts/Chat/panels/InlineSelectorPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/InlineSelectorPanel.qml @@ -199,7 +199,7 @@ Item { StatusButton { Layout.alignment: Qt.AlignVCenter - text: qsTr("Reject") + text: qsTr("Cancel") type: StatusBaseButton.Type.Danger onClicked: root.rejected() } diff --git a/ui/app/AppLayouts/Chat/views/CreateChatView.qml b/ui/app/AppLayouts/Chat/views/CreateChatView.qml index 8e4ad5f57f..70f7a4488f 100644 --- a/ui/app/AppLayouts/Chat/views/CreateChatView.qml +++ b/ui/app/AppLayouts/Chat/views/CreateChatView.qml @@ -19,6 +19,21 @@ Page { property var rootStore property var emojiPopup: null + QtObject { + id: d + + function createChat() { + root.rootStore.createChatInitMessage = chatInput.textInput.text + root.rootStore.createChatFileUrls = chatInput.fileUrls + membersSelector.createChat() + + membersSelector.cleanup() + chatInput.textInput.clear() + + Global.closeCreateChatView() + } + } + padding: 0 Behavior on opacity { NumberAnimation {}} @@ -63,15 +78,7 @@ Page { } } - onConfirmed: { - root.rootStore.createChatInitMessage = chatInput.textInput.text - root.rootStore.createChatFileUrls = chatInput.fileUrls - createChat() - - cleanup() - chatInput.textInput.clear() - Global.closeCreateChatView(); - } + onConfirmed: { d.createChat() } onRejected: { cleanup() @@ -163,15 +170,8 @@ Page { root.rootStore.createChatStickerUrl = url; membersSelector.createChat(); } - onSendMessage: { - root.rootStore.createChatInitMessage = chatInput.textInput.text - root.rootStore.createChatFileUrls = chatInput.fileUrls - membersSelector.createChat() - membersSelector.cleanup() - chatInput.textInput.clear() - Global.closeCreateChatView(); - } + onSendMessage: { d.createChat() } } }