fix(Wallet/BridgeModal): Incorrect preselected recipient value and network model for bridge
- Fixed incorrect preselected recipient object for bridge modal. - Fixed network model assignment for bridge. Fixes #15629
This commit is contained in:
parent
9f03c2d425
commit
480a3ed182
|
@ -331,7 +331,6 @@ Item {
|
|||
}
|
||||
onLaunchBridgeModal: {
|
||||
root.sendModalPopup.preSelectedSendType = Constants.SendType.Bridge
|
||||
root.sendModalPopup.preSelectedRecipient = root.sendModalPopup.preSelectedAccount.address
|
||||
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID
|
||||
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
||||
root.sendModalPopup.onlyAssets = true
|
||||
|
|
|
@ -170,9 +170,19 @@ StatusDialog {
|
|||
onOpened: {
|
||||
amountToSendInput.input.input.edit.forceActiveFocus()
|
||||
|
||||
// IMPORTANT: This step must be the first one since it's storing the send type
|
||||
// into the backend at this stage so that, before this assignement, some properties
|
||||
// should not have the correct value, like `d.isBridgeTx`
|
||||
if(popup.preSelectedSendType !== Constants.SendType.Unknown) {
|
||||
store.setSendType(popup.preSelectedSendType)
|
||||
}
|
||||
|
||||
// To be removed once bridge is splitted to a different component:
|
||||
if(d.isBridgeTx && !!popup.preSelectedAccount) {
|
||||
// Default preselected type is `Helpers.RecipientAddressObjectType.Address` coinciding with bridge usecase
|
||||
popup.preSelectedRecipient = popup.preSelectedAccount.address
|
||||
}
|
||||
|
||||
if (!!popup.preSelectedHoldingID
|
||||
&& popup.preSelectedHoldingType > Constants.TokenType.Native
|
||||
&& popup.preSelectedHoldingType < Constants.TokenType.Unknown) {
|
||||
|
|
|
@ -89,7 +89,7 @@ Item {
|
|||
errorMode: root.errorMode
|
||||
errorType: root.errorType
|
||||
fromNetworksList: root.fromNetworksList
|
||||
toNetworksList: root.suggestedToNetworksList
|
||||
suggestedToNetworksList: root.suggestedToNetworksList
|
||||
// Collectibles don't have a symbol
|
||||
selectedSymbol: !!root.selectedAsset && !!root.selectedAsset.symbol ? root.selectedAsset.symbol: ""
|
||||
weiToEth: function(wei) {
|
||||
|
|
|
@ -22,13 +22,14 @@ RowLayout {
|
|||
property bool isBridgeTx: false
|
||||
property bool isCollectiblesTransfer: false
|
||||
property var fromNetworksList
|
||||
property var toNetworksList
|
||||
property var suggestedToNetworksList
|
||||
property var weiToEth: function(wei) {}
|
||||
property var formatCurrencyAmount: function () {}
|
||||
property var reCalculateSuggestedRoute: function() {}
|
||||
property bool errorMode: false
|
||||
property int errorType: Constants.NoError
|
||||
property string selectedSymbol
|
||||
|
||||
spacing: 10
|
||||
|
||||
StatusRoundIcon {
|
||||
|
@ -57,6 +58,7 @@ RowLayout {
|
|||
qsTr("The networks where the recipient will receive tokens. Amounts calculated automatically for the lowest cost.")
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: visible ? row.height + 10 : 0
|
||||
|
@ -70,18 +72,20 @@ RowLayout {
|
|||
Column {
|
||||
id: row
|
||||
spacing: Style.current.padding
|
||||
|
||||
// TODO: This transformation should come from an adaptor outside this component
|
||||
LeftJoinModel {
|
||||
id: toNetworksListLeftJoinModel
|
||||
|
||||
leftModel: root.suggestedToNetworksList
|
||||
rightModel: root.store.flatNetworksModel
|
||||
joinRole: "chainId"
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
objectName: "networksList"
|
||||
model: LeftJoinModel {
|
||||
leftModel: {
|
||||
const m = isBridgeTx ? root.fromNetworksList : root.toNetworksList
|
||||
return !!m ? m : null
|
||||
}
|
||||
rightModel: root.store.flatNetworksModel
|
||||
joinRole: "chainId"
|
||||
}
|
||||
|
||||
model: isBridgeTx ? root.fromNetworksList : toNetworksListLeftJoinModel
|
||||
delegate: isBridgeTx ? networkItem : routeItem
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue