fix(Contacts): Add Reverse Contact Rejection to profile actions

Close #9897
This commit is contained in:
MishkaRogachev 2023-03-15 19:56:10 +05:30 committed by Mikhail Rogachev
parent 3c1775ba6e
commit 9ff9ad8f09
1 changed files with 24 additions and 2 deletions

View File

@ -182,6 +182,22 @@ Pane {
}
}
Component {
id: btnRevertContactRequestRejectionComponent
StatusButton {
size: StatusButton.Size.Small
text: qsTr("Reverse Contact Rejection")
icon.name: "refresh"
icon.width: 16
icon.height: 16
onClicked: {
root.contactsStore.removeContactRequestRejection(root.publicKey)
d.reload()
}
}
}
Component {
id: btnSendContactRequestComponent
StatusButton {
@ -352,13 +368,19 @@ Pane {
// contact request, outgoing, rejected
if (!d.isContact && d.isContactRequestSent && d.outgoingVerificationStatus === Constants.verificationStatus.declined)
return txtRejectedContactRequestComponent
// contact request, outgoing, pending
if (!d.isContact && d.isContactRequestSent)
return txtPendingContactRequestComponent
// contact request, incoming, pending
if (!d.isContact && d.isContactRequestReceived && !d.contactDetails.removed)
return btnAcceptContactRequestComponent
if (!d.isContact && d.isContactRequestReceived) {
if (d.contactDetails.removed) {
return btnRevertContactRequestRejectionComponent
} else {
return btnAcceptContactRequestComponent
}
}
// contact request, incoming, rejected
if (d.isContactRequestSent && d.incomingVerificationStatus === Constants.verificationStatus.declined)