feat(ChatContextMenu): add confirmation dialog when leaving group chat
Fixes #11998
This commit is contained in:
parent
f71caf8e77
commit
1d644d0b9c
|
@ -231,7 +231,7 @@ StatusMenu {
|
|||
type: StatusAction.Type.Danger
|
||||
onTriggered: {
|
||||
if (root.chatType === Constants.chatType.privateGroupChat) {
|
||||
root.leaveChat(root.chatId);
|
||||
Global.openPopup(leaveGroupConfirmationDialogComponent);
|
||||
} else {
|
||||
Global.openPopup(deleteChatConfirmationDialogComponent);
|
||||
}
|
||||
|
@ -276,6 +276,29 @@ StatusMenu {
|
|||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: leaveGroupConfirmationDialogComponent
|
||||
ConfirmationDialog {
|
||||
confirmButtonObjectName: "leaveGroupConfirmationDialogLeaveButton"
|
||||
headerSettings.title: qsTr("Leave group")
|
||||
confirmationText: qsTr("Are you sure you want to leave group chat <b>%1</b>?").arg(root.chatName)
|
||||
confirmButtonLabel: qsTr("Leave")
|
||||
showCancelButton: true
|
||||
cancelBtnType: "normal"
|
||||
|
||||
onClosed: {
|
||||
destroy()
|
||||
}
|
||||
onCancelButtonClicked: {
|
||||
close()
|
||||
}
|
||||
onConfirmButtonClicked: {
|
||||
root.leaveChat(root.chatId)
|
||||
close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: deleteChatConfirmationDialogComponent
|
||||
ConfirmationDialog {
|
||||
|
|
Loading…
Reference in New Issue