mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 16:47:24 +00:00
fix(@desktop/wallet): Fixing bugs found during demo
This commit is contained in:
parent
7e5ed80847
commit
1f85ec1bd6
@ -148,7 +148,13 @@ QtObject:
|
|||||||
self.items[i].amountOut = ""
|
self.items[i].amountOut = ""
|
||||||
self.items[i].resetToNetworks()
|
self.items[i].resetToNetworks()
|
||||||
self.items[i].hasGas = true
|
self.items[i].hasGas = true
|
||||||
self.dataChanged(index, index, @[ModelRole.AmountIn.int, ModelRole.ToNetworks.int, ModelRole.HasGas.int, ModelRole.AmountOut.int])
|
self.items[i].isEnabled = true
|
||||||
|
self.items[i].isPreferred = true
|
||||||
|
self.items[i].locked = false
|
||||||
|
self.items[i].lockedAmount = ""
|
||||||
|
self.dataChanged(index, index, @[ModelRole.AmountIn.int, ModelRole.ToNetworks.int, ModelRole.HasGas.int,
|
||||||
|
ModelRole.AmountOut.int, ModelRole.IsEnabled.int, ModelRole.IsPreferred.int, ModelRole.Locked.int,
|
||||||
|
ModelRole.LockedAmount.int])
|
||||||
|
|
||||||
proc updateTokenBalanceForSymbol*(self: NetworkModel, chainId: int, tokenBalance: CurrencyAmount) =
|
proc updateTokenBalanceForSymbol*(self: NetworkModel, chainId: int, tokenBalance: CurrencyAmount) =
|
||||||
for i in 0 ..< self.items.len:
|
for i in 0 ..< self.items.len:
|
||||||
|
@ -181,8 +181,6 @@ QtObject:
|
|||||||
self.transactionRoutes = routes
|
self.transactionRoutes = routes
|
||||||
self.suggestedRoutesReady(newQVariant(self.transactionRoutes))
|
self.suggestedRoutesReady(newQVariant(self.transactionRoutes))
|
||||||
proc suggestedRoutes*(self: View, amount: string, sendType: int): string {.slot.} =
|
proc suggestedRoutes*(self: View, amount: string, sendType: int): string {.slot.} =
|
||||||
self.fromNetworksModel.reset()
|
|
||||||
self.toNetworksModel.reset()
|
|
||||||
var parsedAmount = stint.u256("0")
|
var parsedAmount = stint.u256("0")
|
||||||
try:
|
try:
|
||||||
parsedAmount = fromHex(Stuint[256], amount)
|
parsedAmount = fromHex(Stuint[256], amount)
|
||||||
|
@ -153,12 +153,14 @@ Item {
|
|||||||
root.sendModalPopup.sendType = Constants.SendType.Transfer
|
root.sendModalPopup.sendType = Constants.SendType.Transfer
|
||||||
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID
|
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID
|
||||||
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
||||||
|
root.sendModalPopup.onlyAssets = false
|
||||||
root.sendModalPopup.open()
|
root.sendModalPopup.open()
|
||||||
}
|
}
|
||||||
onLaunchBridgeModal: {
|
onLaunchBridgeModal: {
|
||||||
root.sendModalPopup.sendType = Constants.SendType.Bridge
|
root.sendModalPopup.sendType = Constants.SendType.Bridge
|
||||||
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID
|
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID
|
||||||
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType
|
||||||
|
root.sendModalPopup.onlyAssets = true
|
||||||
root.sendModalPopup.open()
|
root.sendModalPopup.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1340,8 +1340,9 @@ Item {
|
|||||||
property string preSelectedHoldingID
|
property string preSelectedHoldingID
|
||||||
property int preSelectedHoldingType
|
property int preSelectedHoldingType
|
||||||
property int sendType: -1
|
property int sendType: -1
|
||||||
|
property bool onlyAssets: false
|
||||||
sourceComponent: SendModal {
|
sourceComponent: SendModal {
|
||||||
onlyAssets: false
|
onlyAssets: sendModal.onlyAssets
|
||||||
onClosed: {
|
onClosed: {
|
||||||
sendModal.closed()
|
sendModal.closed()
|
||||||
sendModal.sendType = -1
|
sendModal.sendType = -1
|
||||||
|
@ -283,32 +283,6 @@ StatusDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TokenListView {
|
|
||||||
id: tokenListRect
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
visible: !d.selectedHolding
|
|
||||||
assets: popup.selectedAccount && popup.selectedAccount.assets ? popup.selectedAccount.assets : null
|
|
||||||
collectibles: popup.selectedAccount ? popup.nestedCollectiblesModel : null
|
|
||||||
onlyAssets: holdingSelector.onlyAssets
|
|
||||||
searchTokenSymbolByAddressFn: function (address) {
|
|
||||||
return store.findTokenSymbolByAddress(address)
|
|
||||||
}
|
|
||||||
getNetworkIcon: function(chainId){
|
|
||||||
return RootStore.getNetworkIcon(chainId)
|
|
||||||
}
|
|
||||||
onTokenSelected: {
|
|
||||||
d.setSelectedHoldingId(symbol, holdingType)
|
|
||||||
}
|
|
||||||
onTokenHovered: {
|
|
||||||
if(hovered) {
|
|
||||||
d.setHoveredHoldingId(symbol, holdingType)
|
|
||||||
} else {
|
|
||||||
d.setHoveredHoldingId("", Constants.HoldingType.Unknown)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
visible: d.isSelectedHoldingValidAsset && !d.isERC721Transfer
|
visible: d.isSelectedHoldingValidAsset && !d.isERC721Transfer
|
||||||
AmountToSend {
|
AmountToSend {
|
||||||
@ -382,6 +356,36 @@ StatusDialog {
|
|||||||
spacing: Style.current.bigPadding
|
spacing: Style.current.bigPadding
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
||||||
|
TokenListView {
|
||||||
|
id: tokenListRect
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.leftMargin: Style.current.bigPadding
|
||||||
|
anchors.rightMargin: Style.current.bigPadding
|
||||||
|
|
||||||
|
visible: !d.selectedHolding
|
||||||
|
assets: popup.selectedAccount && popup.selectedAccount.assets ? popup.selectedAccount.assets : null
|
||||||
|
collectibles: popup.selectedAccount ? popup.nestedCollectiblesModel : null
|
||||||
|
onlyAssets: holdingSelector.onlyAssets
|
||||||
|
searchTokenSymbolByAddressFn: function (address) {
|
||||||
|
return store.findTokenSymbolByAddress(address)
|
||||||
|
}
|
||||||
|
getNetworkIcon: function(chainId){
|
||||||
|
return RootStore.getNetworkIcon(chainId)
|
||||||
|
}
|
||||||
|
onTokenSelected: {
|
||||||
|
d.setSelectedHoldingId(symbol, holdingType)
|
||||||
|
}
|
||||||
|
onTokenHovered: {
|
||||||
|
if(hovered) {
|
||||||
|
d.setHoveredHoldingId(symbol, holdingType)
|
||||||
|
} else {
|
||||||
|
d.setHoveredHoldingId("", Constants.HoldingType.Unknown)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -82,7 +82,7 @@ Item {
|
|||||||
Column {
|
Column {
|
||||||
id: column
|
id: column
|
||||||
width: parent.width
|
width: parent.width
|
||||||
topPadding: 20
|
topPadding: root.onlyAssets ? 0 : 20
|
||||||
|
|
||||||
StatusTabBar {
|
StatusTabBar {
|
||||||
visible: !root.onlyAssets
|
visible: !root.onlyAssets
|
||||||
@ -162,7 +162,7 @@ Item {
|
|||||||
Component {
|
Component {
|
||||||
id: tokenHeader
|
id: tokenHeader
|
||||||
SearchBoxWithRightIcon {
|
SearchBoxWithRightIcon {
|
||||||
showTopBorder: true
|
showTopBorder: !root.onlyAssets
|
||||||
width: parent.width
|
width: parent.width
|
||||||
placeholderText: qsTr("Search for token or enter token address")
|
placeholderText: qsTr("Search for token or enter token address")
|
||||||
onTextChanged: Qt.callLater(d.updateAssetSearchText, text)
|
onTextChanged: Qt.callLater(d.updateAssetSearchText, text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user