refactor(AccountSelector): use built-in onSelectedAccountChanged event

As per comment: https://github.com/status-im/nim-status-client/pull/703#discussion_r467879840
This commit is contained in:
Pascal Precht 2020-08-10 20:44:42 +02:00 committed by Iuri Matias
parent 477f5aa460
commit 246b90b5ae
2 changed files with 2 additions and 4 deletions

View File

@ -109,8 +109,8 @@ Item {
anchors.topMargin: Style.current.padding anchors.topMargin: Style.current.padding
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
onAccountSelected: function (selectedAccount, index) { onSelectedAccountChanged: {
txtAmount.selectedAccount = selectedAccount txtAmount.selectedAccount = selectFromAccount.selectedAccount
} }
} }

View File

@ -17,7 +17,6 @@ Item {
// NOTE: if this asset is not selected as a wallet token in the UI, then // NOTE: if this asset is not selected as a wallet token in the UI, then
// nothing will be displayed // nothing will be displayed
property string showAssetBalance: "" property string showAssetBalance: ""
signal accountSelected(var selectedAccount, int index)
Repeater { Repeater {
visible: showAssetBalance !== "" visible: showAssetBalance !== ""
@ -208,7 +207,6 @@ Item {
anchors.fill: itemContainer anchors.fill: itemContainer
onClicked: { onClicked: {
root.selectedAccount = { address, name, iconColor, assets, fiatBalance } root.selectedAccount = { address, name, iconColor, assets, fiatBalance }
root.accountSelected(root.selectedAccount, index)
select.menu.close() select.menu.close()
} }
} }