show confirmation dialog when leaving chat

This commit is contained in:
Richard Ramos 2021-05-03 16:01:42 -04:00 committed by Iuri Matias
parent 38be2889cd
commit efd1677b24
1 changed files with 15 additions and 1 deletions

View File

@ -134,8 +134,22 @@ PopupMenu {
icon.width: 16
icon.height: 16
icon.color: Style.current.red
onTriggered: chatsModel.leaveChatByIndex(channelContextMenu.channelIndex)
onTriggered: openPopup(deleteChatConfirmationDialogComponent)
enabled: !chatsModel.communities.activeCommunity.active
}
Component {
id: deleteChatConfirmationDialogComponent
ConfirmationDialog {
btnType: "warn"
onClosed: {
destroy()
}
onConfirmButtonClicked: {
chatsModel.leaveChatByIndex(channelContextMenu.channelIndex)
close();
}
}
}
}