mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-22 11:38:57 +00:00
fix(@desktop/chat): Fix for Leave chat is shown instead of Delete confirmation when deleting community channel
fixes #3365
This commit is contained in:
parent
aa8060221c
commit
2448b710b4
@ -218,7 +218,7 @@ Item {
|
||||
onNotificationButtonClicked: activityCenter.open()
|
||||
|
||||
popupMenu: ChatContextMenu {
|
||||
openHandler: {
|
||||
onOpened: {
|
||||
chatItem = chatsModel.channelView.activeChannel
|
||||
}
|
||||
}
|
||||
|
@ -136,16 +136,7 @@ StatusPopupMenu {
|
||||
|
||||
type: StatusMenuItem.Type.Danger
|
||||
onTriggered: {
|
||||
let label = chatItem && chatItem.chatType === Constants.chatTypeOneToOne ?
|
||||
//% "Delete chat"
|
||||
qsTrId("delete-chat") :
|
||||
//% "Leave chat"
|
||||
qsTrId("leave-chat")
|
||||
openPopup(deleteChatConfirmationDialogComponent, {
|
||||
title: label,
|
||||
confirmButtonLabel: label,
|
||||
chatId: chatItem.id
|
||||
})
|
||||
openPopup(deleteChatConfirmationDialogComponent)
|
||||
}
|
||||
|
||||
enabled: !communityActive || chatsModel.communities.activeCommunity.admin
|
||||
@ -166,13 +157,27 @@ StatusPopupMenu {
|
||||
Component {
|
||||
id: deleteChatConfirmationDialogComponent
|
||||
ConfirmationDialog {
|
||||
property string chatId
|
||||
property string chatId: chatItem.id
|
||||
btnType: "warn"
|
||||
confirmationText: communityActive ? qsTr("Are you sure you want to delete this channel?") :
|
||||
header.title: communityActive ? qsTr("Delete #%1").arg(chatItem.name) :
|
||||
chatItem && chatItem.chatType === Constants.chatTypeOneToOne ?
|
||||
//% "Delete chat"
|
||||
qsTrId("delete-chat") :
|
||||
//% "Leave chat"
|
||||
qsTrId("leave-chat")
|
||||
confirmButtonLabel: communityActive ? qsTr("Delete") : header.title
|
||||
confirmationText: communityActive ? qsTr("Are you sure you want to delete #%1 channel?").arg(chatItem.name) :
|
||||
chatItem && chatItem.chatType === Constants.chatTypeOneToOne ?
|
||||
qsTr("Are you sure you want to delete this chat?"):
|
||||
qsTr("Are you sure you want to leave this chat?")
|
||||
showCancelButton: communityActive
|
||||
|
||||
onClosed: {
|
||||
destroy()
|
||||
}
|
||||
onCancelButtonClicked: {
|
||||
close()
|
||||
}
|
||||
onConfirmButtonClicked: {
|
||||
if (communityActive) {
|
||||
chatsModel.communities.deleteCommunityChat(chatsModel.communities.activeCommunity.id, chatId)
|
||||
|
@ -23,7 +23,7 @@ StatusModal {
|
||||
property alias checkbox: checkbox
|
||||
|
||||
|
||||
header.title: qsTr("Confirm you action")
|
||||
header.title: qsTr("Confirm your action")
|
||||
focus: visible
|
||||
|
||||
signal confirmButtonClicked()
|
||||
|
Loading…
x
Reference in New Issue
Block a user