feat(@chat): disable tx in chat when no wallet

fixes #5461
This commit is contained in:
Anthony Laibe 2022-04-11 11:26:13 +02:00 committed by Anthony Laibe
parent 538cd6ae06
commit bda2114209
2 changed files with 3 additions and 35 deletions

View File

@ -48,7 +48,7 @@ Popup {
text: qsTrId("send-transaction") text: qsTrId("send-transaction")
icon.color: Style.current.purple icon.color: Style.current.purple
icon.name: "send" icon.name: "send"
onClicked: RootStore.isWalletEnabled ? root.sendTransactionCommandButtonClicked() : sendConfirmationPopup.open() onClicked: root.sendTransactionCommandButtonClicked()
} }
@ -58,39 +58,7 @@ Popup {
icon.color: Style.current.orange icon.color: Style.current.orange
icon.name: "send" icon.name: "send"
icon.rotation: 180 icon.rotation: 180
onClicked: RootStore.isWalletEnabled ? root.receiveTransactionCommandButtonClicked() : receiveConfirmationPopup.open() onClicked: root.receiveTransactionCommandButtonClicked()
}
ConfirmationDialog {
id: sendConfirmationPopup
showCancelButton: true
confirmationText: qsTr("This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk.")
confirmButtonLabel: qsTr("I understand")
onConfirmButtonClicked: {
RootStore.enableWallet();
close()
root.sendTransactionCommandButtonClicked()
}
onCancelButtonClicked: {
close()
}
}
ConfirmationDialog {
id: receiveConfirmationPopup
showCancelButton: true
confirmationText: qsTr("This feature is experimental and is meant for testing purposes by core contributors and the community. It's not meant for real use and makes no claims of security or integrity of funds or data. Use at your own risk.")
confirmButtonLabel: qsTr("I understand")
onConfirmButtonClicked: {
RootStore.enableWallet();
close()
root.receiveTransactionCommandButtonClicked()
}
onCancelButtonClicked: {
close()
}
} }
} }
} }

View File

@ -778,7 +778,7 @@ Rectangle {
anchors.bottomMargin: 16 anchors.bottomMargin: 16
icon.name: "chat-commands" icon.name: "chat-commands"
type: StatusQ.StatusFlatRoundButton.Type.Tertiary type: StatusQ.StatusFlatRoundButton.Type.Tertiary
visible: !isEdit && control.chatType === Constants.chatType.oneToOne && !control.isStatusUpdateInput visible: RootStore.isWalletEnabled && !isEdit && control.chatType === Constants.chatType.oneToOne && !control.isStatusUpdateInput
enabled: !control.isContactBlocked enabled: !control.isContactBlocked
onClicked: { onClicked: {
chatCommandsPopup.opened ? chatCommandsPopup.opened ?