fix(@desktop/wallet): Fix for Swap - Pay and Receive assets get unselected, Pay amount resets to 0

fixes #15525
This commit is contained in:
Khushboo Mehta 2024-07-16 13:30:48 +02:00 committed by Khushboo-dev-cpp
parent 1d7ab859be
commit ec86a30d6e
2 changed files with 14 additions and 3 deletions

View File

@ -932,10 +932,10 @@ Item {
verify(!amountToSendInput.input.input.edit.cursorVisible)
compare(amountToSendInput.input.placeholderText, LocaleUtils.numberToLocaleString(0))
compare(bottomItemText.text, root.swapAdaptor.currencyStore.formatCurrencyAmount(0, root.swapAdaptor.currencyStore.currentCurrency))
compare(holdingSelector.currentTokensKey, "")
compare(tokenSelectorContentItemText.text, qsTr("Select asset"))
compare(holdingSelector.currentTokensKey, "STT")
compare(tokenSelectorContentItemText.text, "STT")
verify(!maxTagButton.visible)
compare(receivePanel.selectedHoldingId, "")
compare(receivePanel.selectedHoldingId, "STT")
compare(receivePanel.value, 0)
compare(receivePanel.rawValue, "0")
verify(!receivePanel.valueValid)

View File

@ -121,6 +121,17 @@ Control {
}
}
/* TODO: remove after https://github.com/status-im/status-desktop/issues/15604 is
implemented as this is hack to set token values correctly when model is reset */
Connections {
target: holdingSelector.model
function onRowsInserted() {
if(!!tokenKey) {
root.reevaluateSelectedId()
}
}
}
background: Shape {
id: shape