Skip to content

Commit

Permalink
fix(CreateChat): Text input is displayed when choosing contacts for n…
Browse files Browse the repository at this point in the history
…ew 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 status-im#7706
  • Loading branch information
noeliaSD committed Nov 16, 2022
1 parent c256ac0 commit 4cdc2f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Chat/panels/InlineSelectorPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Item {

StatusButton {
Layout.alignment: Qt.AlignVCenter
text: qsTr("Reject")
text: qsTr("Cancel")
type: StatusBaseButton.Type.Danger
onClicked: root.rejected()
}
Expand Down
36 changes: 18 additions & 18 deletions ui/app/AppLayouts/Chat/views/CreateChatView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}}
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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() }
}
}

Expand Down

0 comments on commit 4cdc2f8

Please sign in to comment.