From bda211420974e4c812dcc85bc588d365e2de250f Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 11 Apr 2022 11:26:13 +0200 Subject: [PATCH] feat(@chat): disable tx in chat when no wallet fixes #5461 --- .../shared/popups/ChatCommandsPopup.qml | 36 ++----------------- ui/imports/shared/status/StatusChatInput.qml | 2 +- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/ui/imports/shared/popups/ChatCommandsPopup.qml b/ui/imports/shared/popups/ChatCommandsPopup.qml index e738092f14..91554f89c9 100644 --- a/ui/imports/shared/popups/ChatCommandsPopup.qml +++ b/ui/imports/shared/popups/ChatCommandsPopup.qml @@ -48,7 +48,7 @@ Popup { text: qsTrId("send-transaction") icon.color: Style.current.purple icon.name: "send" - onClicked: RootStore.isWalletEnabled ? root.sendTransactionCommandButtonClicked() : sendConfirmationPopup.open() + onClicked: root.sendTransactionCommandButtonClicked() } @@ -58,39 +58,7 @@ Popup { icon.color: Style.current.orange icon.name: "send" icon.rotation: 180 - onClicked: RootStore.isWalletEnabled ? root.receiveTransactionCommandButtonClicked() : receiveConfirmationPopup.open() - } - - 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() - } + onClicked: root.receiveTransactionCommandButtonClicked() } } } diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 9a239cec0e..1544be64e9 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -778,7 +778,7 @@ Rectangle { anchors.bottomMargin: 16 icon.name: "chat-commands" 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 onClicked: { chatCommandsPopup.opened ?