From cd061895c2617ef1f3af1b3d57d6f3dfe31103b0 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 29 Jun 2020 10:33:21 -0400 Subject: [PATCH] fix: fix a couple of warning with the send modal --- ui/app/AppLayouts/Wallet/SendModal.qml | 2 +- .../AppLayouts/Wallet/components/SendModalContent.qml | 11 +++++++---- ui/shared/Select.qml | 2 -- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/SendModal.qml b/ui/app/AppLayouts/Wallet/SendModal.qml index 8c7bd79280..7e0fbc9422 100644 --- a/ui/app/AppLayouts/Wallet/SendModal.qml +++ b/ui/app/AppLayouts/Wallet/SendModal.qml @@ -30,7 +30,7 @@ ModalPopup { SendModalContent { id: sendModalContent - accounts: walletModel.accounts + accounts: [] } footer: StyledButton { diff --git a/ui/app/AppLayouts/Wallet/components/SendModalContent.qml b/ui/app/AppLayouts/Wallet/components/SendModalContent.qml index 01d919c9ff..3c091a7d2e 100644 --- a/ui/app/AppLayouts/Wallet/components/SendModalContent.qml +++ b/ui/app/AppLayouts/Wallet/components/SendModalContent.qml @@ -11,7 +11,10 @@ Item { property var accounts property string defaultAccount: "0x1234" property int selectedAccountIndex: 0 - property string selectedAccountAddress: accounts[selectedAccountIndex].address + property string selectedAccountAddress: accounts && accounts.length ? accounts[selectedAccountIndex].address : "" + property string selectedAccountName: accounts && accounts.length ? accounts[selectedAccountIndex].name : "" + property string selectedAccountIconColor: accounts && accounts.length ? accounts[selectedAccountIndex].iconColor : "" + property string passwordValidationError: "" property string toValidationError: "" @@ -63,11 +66,11 @@ Item { iconHeight: 12 iconWidth: 12 icon: "../../../img/walletIcon.svg" - iconColor: accounts[selectedAccountIndex].iconColor + iconColor: selectedAccountIconColor label: qsTr("From account") anchors.top: txtAmount.bottom anchors.topMargin: Theme.padding - selectedText: accounts[selectedAccountIndex].name + selectedText: selectedAccountName selectOptions: sendModalContent.accounts.map(function (account, index) { return { text: account.name, @@ -80,7 +83,7 @@ Item { StyledText { id: textSelectAccountAddress - text: accounts[selectedAccountIndex].address + text: selectedAccountAddress anchors.right: parent.right anchors.left: parent.left anchors.leftMargin: 2 diff --git a/ui/shared/Select.qml b/ui/shared/Select.qml index 9ccfe12652..b1efecc30d 100644 --- a/ui/shared/Select.qml +++ b/ui/shared/Select.qml @@ -133,8 +133,6 @@ Item { MenuItem { property var onClicked: console.log("Default click function. Override me please") property color bgColor: Theme.white - anchors.right: parent.right - anchors.left: parent.left onTriggered: function () { onClicked() }