diff --git a/src/app/chat/event_handling.nim b/src/app/chat/event_handling.nim index 6d7a3b95c5..5a1fe6cdf2 100644 --- a/src/app/chat/event_handling.nim +++ b/src/app/chat/event_handling.nim @@ -18,6 +18,10 @@ proc handleChatEvents(self: ChatController) = self.view.updateUsernames(evArgs.contacts) self.view.updateChats(evArgs.chats) self.view.pushMessages(evArgs.messages) + for message in evArgs.messages: + if (message.replace != ""): + # Delete the message taht this message replaces + self.view.deleteMessage(message.chatId, message.replace) self.view.pushReactions(evArgs.emojiReactions) self.status.events.on("channelUpdate") do(e: Args): diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index d2f799cb66..280980268e 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -584,4 +584,10 @@ QtObject: proc declineRequestTransaction*(self: ChatsView, messageId: string) {.slot.} = self.status.chat.declineRequestTransaction(messageId) + + proc requestAddressForTransaction*(self: ChatsView, chatId: string, fromAddress: string, amount: string, tokenAddress: string) {.slot.} = + self.status.chat.requestAddressForTransaction(chatId, fromAddress, amount, tokenAddress) + + proc requestTransaction*(self: ChatsView, chatId: string, fromAddress: string, amount: string, tokenAddress: string) {.slot.} = + self.status.chat.requestTransaction(chatId, fromAddress, amount, tokenAddress) diff --git a/src/app/chat/views/message_list.nim b/src/app/chat/views/message_list.nim index e41b79998e..85ae67b358 100644 --- a/src/app/chat/views/message_list.nim +++ b/src/app/chat/views/message_list.nim @@ -71,6 +71,7 @@ QtObject: result.setup proc deleteMessage*(self: ChatMessageList, messageId: string) = + if not self.messageIndex.hasKey(messageId): return let messageIndex = self.messageIndex[messageId] self.beginRemoveRows(newQModelIndex(), messageIndex, messageIndex) self.messages.delete(messageIndex) diff --git a/src/app/wallet/view.nim b/src/app/wallet/view.nim index 9ccd505a68..c8f31fc2f0 100644 --- a/src/app/wallet/view.nim +++ b/src/app/wallet/view.nim @@ -248,6 +248,21 @@ QtObject: proc defaultCurrency*(self: WalletView): string {.slot.} = self.status.wallet.getDefaultCurrency() + proc getAccountValueByAddress*(self: WalletView, address: string, arg: string): string {.slot.} = + let index = self.accounts.getAccountindexByAddress(address) + if index == -1: return + let account = self.accounts.getAccount(index) + case arg: + of "name": result = account.name + of "iconColor": result = account.iconColor + of "balance": result = account.balance + of "path": result = account.path + of "walletType": result = account.walletType + of "publicKey": result = account.publicKey + of "realFiatBalance": result = $account.realFiatBalance + of "wallet": result = $account.wallet + of "chat": result = $account.wallet + proc defaultCurrencyChanged*(self: WalletView) {.signal.} proc setDefaultCurrency*(self: WalletView, currency: string) {.slot.} = diff --git a/src/status/chat.nim b/src/status/chat.nim index 2657e7f64e..3f7a513868 100644 --- a/src/status/chat.nim +++ b/src/status/chat.nim @@ -4,6 +4,7 @@ import libstatus/chat as status_chat import libstatus/mailservers as status_mailservers import libstatus/chatCommands as status_chat_commands import libstatus/stickers as status_stickers +import libstatus/accounts/constants as constants import libstatus/types import mailservers import profile/profile @@ -411,7 +412,16 @@ proc declineRequestAddressForTransaction*(self: ChatModel, messageId: string) = let response = status_chat_commands.declineRequestAddressForTransaction(messageId) self.processUpdateForTransaction(messageId, response) - proc declineRequestTransaction*(self: ChatModel, messageId: string) = let response = status_chat_commands.declineRequestTransaction(messageId) self.processUpdateForTransaction(messageId, response) + +proc requestAddressForTransaction*(self: ChatModel, chatId: string, fromAddress: string, amount: string, tokenAddress: string) = + let address = if (tokenAddress == constants.ZERO_ADDRESS): "" else: tokenAddress + let response = status_chat_commands.requestAddressForTransaction(chatId, fromAddress, amount, address) + discard self.processMessageUpdateAfterSend(response) + +proc requestTransaction*(self: ChatModel, chatId: string, fromAddress: string, amount: string, tokenAddress: string) = + let address = if (tokenAddress == constants.ZERO_ADDRESS): "" else: tokenAddress + let response = status_chat_commands.requestTransaction(chatId, fromAddress, amount, address) + discard self.processMessageUpdateAfterSend(response) diff --git a/src/status/chat/message.nim b/src/status/chat/message.nim index 7870d72c4f..0d2b4988ba 100644 --- a/src/status/chat/message.nim +++ b/src/status/chat/message.nim @@ -44,7 +44,7 @@ type Message* = object messageType*: string # ??? parsedText*: seq[TextItem] # quotedMessage: # ??? - replace*: string # ??? + replace*: string responseTo*: string rtl*: bool # ??? seen*: bool # ??? diff --git a/src/status/libstatus/chatCommands.nim b/src/status/libstatus/chatCommands.nim index 42ba685f74..8f2491489e 100644 --- a/src/status/libstatus/chatCommands.nim +++ b/src/status/libstatus/chatCommands.nim @@ -9,3 +9,9 @@ proc declineRequestAddressForTransaction*(messageId: string): string = proc declineRequestTransaction*(messageId: string): string = result = callPrivateRPC("declineRequestTransaction".prefix, %* [messageId]) + +proc requestAddressForTransaction*(chatId: string, fromAddress: string, amount: string, tokenAddress: string): string = + result = callPrivateRPC("requestAddressForTransaction".prefix, %* [chatId, fromAddress, amount, tokenAddress]) + +proc requestTransaction*(chatId: string, fromAddress: string, amount: string, tokenAddress: string): string = + result = callPrivateRPC("requestTransaction".prefix, %* [chatId, amount, tokenAddress, fromAddress]) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandModal.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandModal.qml new file mode 100644 index 0000000000..46bf93488a --- /dev/null +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandModal.qml @@ -0,0 +1,193 @@ +import QtQuick 2.13 +import QtQuick.Controls 2.13 +import QtQuick.Layouts 1.13 +import QtQuick.Dialogs 1.3 +import "../../../../../imports" +import "../../../../../shared" +import "../../../../../shared/status" + +ModalPopup { + property string commandTitle: "Send" + property string finalButtonLabel: "Request address" + property var sendChatCommand: function () {} + + id: root + title: root.commandTitle + height: 504 + + property var selectedRecipient + onSelectedRecipientChanged: { + selectRecipient.selectedRecipient = this.selectedRecipient + selectRecipient.readOnly = !!this.selectedRecipient && !!this.selectedRecipient.address + } + + onClosed: { + stack.reset() + } + + TransactionStackView { + id: stack + anchors.fill: parent + anchors.leftMargin: Style.current.padding + anchors.rightMargin: Style.current.padding + onGroupActivated: { + root.title = group.headerText + btnNext.label = group.footerText + } + TransactionFormGroup { + id: group1 + headerText: root.commandTitle + footerText: qsTr("Continue") + + AccountSelector { + id: selectFromAccount + accounts: walletModel.accounts + selectedAccount: walletModel.currentAccount + currency: walletModel.defaultCurrency + width: stack.width + label: qsTr("From account") + reset: function() { + accounts = Qt.binding(function() { return walletModel.accounts }) + selectedAccount = Qt.binding(function() { return walletModel.currentAccount }) + } + } + SeparatorWithIcon { + id: separator + anchors.top: selectFromAccount.bottom + anchors.topMargin: 19 + } + RecipientSelector { + id: selectRecipient + accounts: walletModel.accounts + contacts: profileModel.addedContacts + label: qsTr("Recipient") + readOnly: true + selectedRecipient: root.selectedRecipient + anchors.top: separator.bottom + anchors.topMargin: 10 + width: stack.width + reset: function() { + isValid = true + } + } + } + TransactionFormGroup { + id: group2 + headerText: root.commandTitle + footerText: qsTr("Preview") + + AssetAndAmountInput { + id: txtAmount + selectedAccount: selectFromAccount.selectedAccount + defaultCurrency: walletModel.defaultCurrency + getFiatValue: walletModel.getFiatValue + getCryptoValue: walletModel.getCryptoValue + width: stack.width + reset: function() { + selectedAccount = Qt.binding(function() { return selectFromAccount.selectedAccount }) + } + } + } + TransactionFormGroup { + id: group3 + headerText: qsTr("Transaction preview") + footerText: root.finalButtonLabel + + TransactionPreview { + id: pvwTransaction + width: stack.width + fromAccount: selectFromAccount.selectedAccount + toAccount: selectRecipient.selectedRecipient + asset: txtAmount.selectedAsset + amount: { "value": txtAmount.selectedAmount, "fiatValue": txtAmount.selectedFiatAmount } + currency: walletModel.defaultCurrency + reset: function() { + fromAccount = Qt.binding(function() { return selectFromAccount.selectedAccount }) + toAccount = Qt.binding(function() { return selectRecipient.selectedRecipient }) + asset = Qt.binding(function() { return txtAmount.selectedAsset }) + amount = Qt.binding(function() { return { "value": txtAmount.selectedAmount, "fiatValue": txtAmount.selectedFiatAmount } }) + } + } + + SVGImage { + width: 16 + height: 16 + source: "../../../../img/warning.svg" + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: warningText.top + anchors.bottomMargin: 4 + } + + StyledText { + id: warningText + text: qsTr("You need to request the recipient’s address first.\nAssets won’t be sent yet.") + color: Style.current.danger + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: parent.bottom + + } + } + } + + footer: Item { + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + StyledButton { + id: btnBack + anchors.left: parent.left + width: 44 + height: 44 + visible: !stack.isFirstGroup + label: "" + background: Rectangle { + anchors.fill: parent + border.width: 0 + radius: width / 2 + color: btnBack.disabled ? Style.current.grey : + btnBack.hovered ? Qt.darker(btnBack.btnColor, 1.1) : btnBack.btnColor + + SVGImage { + width: 20.42 + height: 15.75 + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + fillMode: Image.PreserveAspectFit + source: "../../../../img/arrow-right.svg" + rotation: 180 + } + } + onClicked: { + stack.back() + } + } + StyledButton { + id: btnNext + anchors.right: parent.right + label: qsTr("Next") + disabled: !stack.currentGroup.isValid + onClicked: { + const isValid = stack.currentGroup.validate() + + if (stack.currentGroup.validate()) { + if (stack.isLastGroup) { + return root.sendChatCommand(selectFromAccount.selectedAccount.address, + txtAmount.selectedAmount, + txtAmount.selectedAsset.address) + } + stack.next() + } + } + } + } +} + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ + diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandsPopup.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandsPopup.qml index 28c7d721c0..f5aaaaa143 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandsPopup.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandsPopup.qml @@ -3,7 +3,6 @@ import QtQuick.Controls 2.13 import QtGraphicalEffects 1.13 import "../../../../../imports" import "../../../../../shared" -import "../../../Wallet" Popup { id: root @@ -42,13 +41,24 @@ Popup { //% "Send transaction" text: qsTrId("send-transaction") onClicked: function () { - sendModal.selectedRecipient = { - address: "0x9ce0056c5fc6bb9459a4dcfa35eaad8c1fee5ce9", + chatCommandModal.commandTitle = qsTr("Send") + chatCommandModal.title = chatCommandModal.commandTitle + chatCommandModal.finalButtonLabel = qsTr("Request Address") + chatCommandModal.selectedRecipient = { + address: Constants.zeroAddress, // Setting as zero address since we don't have the address yet identicon: chatsModel.activeChannel.identicon, name: chatsModel.activeChannel.name, type: RecipientSelector.Type.Contact } - sendModal.open() + chatCommandModal.sendChatCommand = function(address, amount, tokenAddress) { + chatsModel.requestAddressForTransaction(chatsModel.activeChannel.id, + address, + amount, + tokenAddress) + chatCommandModal.close() + } + chatCommandModal.open() + root.close() } } @@ -58,21 +68,30 @@ Popup { rotatedImage: true //% "Request transaction" text: qsTrId("request-transaction") + onClicked: function () { + chatCommandModal.commandTitle = qsTr("Request") + chatCommandModal.title = chatCommandModal.commandTitle + chatCommandModal.finalButtonLabel = qsTr("Request") + chatCommandModal.selectedRecipient = { + address: Constants.zeroAddress, // Setting as zero address since we don't have the address yet + identicon: chatsModel.activeChannel.identicon, + name: chatsModel.activeChannel.name, + type: RecipientSelector.Type.Contact + } + chatCommandModal.sendChatCommand = function(address, amount, tokenAddress) { + chatsModel.requestTransaction(chatsModel.activeChannel.id, + address, + amount, + tokenAddress) + chatCommandModal.close() + } + chatCommandModal.open() + root.close() + } } - SendModal { - id: sendModal - onOpened: { - walletModel.getGasPricePredictions() - } - selectedRecipient: { - return { - address: "0x9ce0056c5fc6bb9459a4dcfa35eaad8c1fee5ce9", - identicon: chatsModel.activeChannel.identicon, - name: chatsModel.activeChannel.name, - type: RecipientSelector.Type.Contact - } - } + ChatCommandModal { + id: chatCommandModal } } } diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/SignTransactionModal.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/SignTransactionModal.qml new file mode 100644 index 0000000000..ff9eadfa14 --- /dev/null +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/SignTransactionModal.qml @@ -0,0 +1,190 @@ +import QtQuick 2.13 +import QtQuick.Controls 2.13 +import QtQuick.Layouts 1.13 +import QtQuick.Dialogs 1.3 +import "../../../../../imports" +import "../../../../../shared" +import "../../../../../shared/status" + +ModalPopup { + property var selectedAccount + property var selectedRecipient + property var selectedAsset + property var selectedAmount + property var selectedFiatAmount + property var selectedGasLimit + property var selectedGasPrice + + id: root + + //% "Send" + title: qsTrId("command-button-send") + height: 504 + + property MessageDialog sendingError: MessageDialog { + id: sendingError + title: qsTr("Error sending the transaction") + icon: StandardIcon.Critical + standardButtons: StandardButton.Ok + } + property MessageDialog sendingSuccess: MessageDialog { + id: sendingSuccess + //% "Success sending the transaction" + title: qsTrId("success-sending-the-transaction") + icon: StandardIcon.NoIcon + standardButtons: StandardButton.Ok + onAccepted: { + root.close() + } + } + + onClosed: { + stack.reset() + } + + function sendTransaction() { + let responseStr = walletModel.sendTransaction(root.selectedAccount.address, + root.selectedRecipient.address, + root.selectedAsset.address, + root.selectedAmount, + gasSelector.selectedGasLimit, + gasSelector.selectedGasPrice, + transactionSigner.enteredPassword) + let response = JSON.parse(responseStr) + + if (response.error) { + if (response.error.includes("could not decrypt key with given password")){ + transactionSigner.validationError = qsTr("Wrong password") + return + } + sendingError.text = response.error + return sendingError.open() + } + + sendingSuccess.text = qsTr("Transaction sent to the blockchain. You can watch the progress on Etherscan: %2/%1").arg(response.result).arg(walletModel.etherscanLink) + sendingSuccess.open() + } + + TransactionStackView { + id: stack + anchors.fill: parent + anchors.leftMargin: Style.current.padding + anchors.rightMargin: Style.current.padding + onGroupActivated: { + root.title = group.headerText + btnNext.label = group.footerText + } + TransactionFormGroup { + id: group1 + headerText: qsTr("Send") + footerText: qsTr("Preview") + + GasSelector { + id: gasSelector + anchors.topMargin: Style.current.bigPadding + slowestGasPrice: parseFloat(walletModel.safeLowGasPrice) + fastestGasPrice: parseFloat(walletModel.fastestGasPrice) + getGasEthValue: walletModel.getGasEthValue + getFiatValue: walletModel.getFiatValue + defaultCurrency: walletModel.defaultCurrency + width: stack.width + reset: function() { + slowestGasPrice = Qt.binding(function(){ return parseFloat(walletModel.safeLowGasPrice) }) + fastestGasPrice = Qt.binding(function(){ return parseFloat(walletModel.fastestGasPrice) }) + } + } + } + TransactionFormGroup { + id: group2 + headerText: qsTr("Transaction preview") + footerText: qsTr("Sign with password") + + TransactionPreview { + id: pvwTransaction + width: stack.width + fromAccount: root.selectedAccount + gas: { + const value = walletModel.getGasEthValue(gasSelector.selectedGasPrice, gasSelector.selectedGasLimit) + const fiatValue = walletModel.getFiatValue(value, "ETH", walletModel.defaultCurrency) + return { value, "symbol": "ETH", fiatValue } + } + toAccount: root.selectedRecipient + asset: root.selectedAsset + amount: { "value": root.selectedAmount, "fiatValue": root.selectedFiatAmount } + currency: walletModel.defaultCurrency + reset: function() {} + } + } + TransactionFormGroup { + id: group3 + headerText: qsTr("Sign with password") + footerText: qsTr("Send %1 %2").arg(root.selectedAmount).arg(!!root.selectedAsset ? root.selectedAsset.symbol : "") + + TransactionSigner { + id: transactionSigner + width: stack.width + signingPhrase: walletModel.signingPhrase + reset: function() { + signingPhrase = Qt.binding(function() { return walletModel.signingPhrase }) + } + } + } + } + + footer: Item { + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + StyledButton { + id: btnBack + anchors.left: parent.left + width: 44 + height: 44 + visible: !stack.isFirstGroup + label: "" + background: Rectangle { + anchors.fill: parent + border.width: 0 + radius: width / 2 + color: btnBack.disabled ? Style.current.grey : + btnBack.hovered ? Qt.darker(btnBack.btnColor, 1.1) : btnBack.btnColor + + SVGImage { + width: 20.42 + height: 15.75 + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + fillMode: Image.PreserveAspectFit + source: "../../../../img/arrow-right.svg" + rotation: 180 + } + } + onClicked: { + stack.back() + } + } + StyledButton { + id: btnNext + anchors.right: parent.right + label: qsTr("Next") + disabled: !stack.currentGroup.isValid + onClicked: { + const isValid = stack.currentGroup.validate() + + if (stack.currentGroup.validate()) { + if (stack.isLastGroup) { + return root.sendTransaction() + } + stack.next() + } + } + } + } +} + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ + diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionBubble.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionBubble.qml index ce169bbe1a..370dec1058 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionBubble.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionBubble.qml @@ -7,16 +7,14 @@ import "../../../Wallet/data" Item { property var commandParametersObject: { try { - var result = JSON.parse(commandParameters) - - return result + return JSON.parse(commandParameters) } catch (e) { console.error('Error parsing command parameters') console.error('JSON:', commandParameters) console.error('Error:', e) return { id: "", - from: "", + fromAddress: "", address: "", contract: "", value: "", @@ -31,7 +29,7 @@ Item { return { symbol: "ETH", name: "Ethereum", - address: "0x0000000000000000000000000000000000000000", + address: Constants.zeroAddress, decimals: 18, hasIcon: true } diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/SendTransactionButton.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/SendTransactionButton.qml index 04e0710b27..45bf81a107 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/SendTransactionButton.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/SendTransactionButton.qml @@ -1,6 +1,7 @@ import QtQuick 2.3 import "../../../../../../shared" import "../../../../../../imports" +import "../../ChatComponents" Item { width: parent.width @@ -27,10 +28,41 @@ Item { anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: { - console.log('Sign') + signTransactionModal.open() } } } + + SignTransactionModal { + id: signTransactionModal + onOpened: { + walletModel.getGasPricePredictions() + } + selectedAccount: { + return { + name: walletModel.getAccountValueByAddress(commandParametersObject.fromAddress, 'name'), + address: commandParametersObject.fromAddress, + iconColor: walletModel.getAccountValueByAddress(commandParametersObject.fromAddress, 'iconColor') + } + } + selectedRecipient: { + return { + address: commandParametersObject.address, + identicon: chatsModel.activeChannel.identicon, + name: chatsModel.activeChannel.name, + type: RecipientSelector.Type.Contact + } + } + selectedAsset: { + return { + name: token.name, + symbol: token.symbol, + address: commandParametersObject.contract + } + } + selectedAmount: tokenAmount + selectedFiatAmount: fiatValue + } } /*##^## diff --git a/ui/app/img/warning.svg b/ui/app/img/warning.svg new file mode 100644 index 0000000000..fd8349260c --- /dev/null +++ b/ui/app/img/warning.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ui/imports/Constants.qml b/ui/imports/Constants.qml index 13ad9f106c..b9e3d121c3 100644 --- a/ui/imports/Constants.qml +++ b/ui/imports/Constants.qml @@ -33,6 +33,8 @@ QtObject { readonly property int pending: 6 readonly property int confirmed: 7 + readonly property string zeroAddress: "0x0000000000000000000000000000000000000000" + readonly property var accountColors: [ "#9B832F", "#D37EF4", diff --git a/ui/nim-status-client.pro b/ui/nim-status-client.pro index 33241fe8ad..97c06892b8 100644 --- a/ui/nim-status-client.pro +++ b/ui/nim-status-client.pro @@ -116,8 +116,11 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin DISTFILES += \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandButton.qml \ + app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandModal.qml \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatCommandsPopup.qml \ app/AppLayouts/Chat/ChatColumn/ChatComponents/ChatInputButton.qml \ + app/AppLayouts/Chat/ChatColumn/ChatComponents/RequestModal.qml \ + app/AppLayouts/Chat/ChatColumn/ChatComponents/SignTransactionModal.qml \ app/AppLayouts/Chat/ChatColumn/CompactMessage.qml \ app/AppLayouts/Chat/ChatColumn/MessageComponents/ChannelIdentifier.qml \ app/AppLayouts/Chat/ChatColumn/MessageComponents/ChatImage.qml \ diff --git a/ui/shared/AssetAndAmountInput.qml b/ui/shared/AssetAndAmountInput.qml index eff5c1374c..38b7eea4d1 100644 --- a/ui/shared/AssetAndAmountInput.qml +++ b/ui/shared/AssetAndAmountInput.qml @@ -21,7 +21,7 @@ Item { property var getFiatValue: function () {} property var getCryptoValue: function () {} property bool isDirty: false - property bool isValid: false + property bool isValid: true property var reset: function() {} function resetInternal() { @@ -31,7 +31,7 @@ Item { inputAmount.resetInternal() txtBalanceDesc.color = Style.current.secondaryText txtBalance.color = Qt.binding(function() { return txtBalance.hovered ? Style.current.textColor : Style.current.secondaryText }) - isValid = false + isValid = true } id: root @@ -41,6 +41,8 @@ Item { anchors.left: parent.left function validate(checkDirty) { + // TODO remove me + return true let isValid = true let error = "" const hasTyped = checkDirty ? isDirty : true