fix(@desktop/wallet): Various wallet view fixes (#11606)
This commit is contained in:
parent
b5950b045c
commit
d05d743d80
|
@ -46,7 +46,6 @@ proc setAddress*(self: Filter, address: string) =
|
||||||
self.addresses = @[address]
|
self.addresses = @[address]
|
||||||
|
|
||||||
proc removeAddress*(self: Filter, address: string) =
|
proc removeAddress*(self: Filter, address: string) =
|
||||||
self.allAddresses = false
|
|
||||||
if len(self.addresses) == 1 and self.addresses[0] == address:
|
if len(self.addresses) == 1 and self.addresses[0] == address:
|
||||||
let accounts = self.controller.getWalletAccounts()
|
let accounts = self.controller.getWalletAccounts()
|
||||||
self.addresses = @[accounts[0].address]
|
self.addresses = @[accounts[0].address]
|
||||||
|
|
|
@ -174,7 +174,7 @@ StatusListItem {
|
||||||
if (root.areTestNetworksEnabled) {
|
if (root.areTestNetworksEnabled) {
|
||||||
baseUrl = Constants.networkExplorerLinks.goerliEtherscan
|
baseUrl = Constants.networkExplorerLinks.goerliEtherscan
|
||||||
}
|
}
|
||||||
Global.openLink("%1/address/%2".arg(baseUrl).arg(d.visibleAddress ? d.visibleAddress : root.ens))
|
Global.openLink("%1/%2/%3".arg(baseUrl).arg(Constants.networkExplorerLinks.addressPath).arg(d.visibleAddress ? d.visibleAddress : root.ens))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ StatusListItem {
|
||||||
if (root.areTestNetworksEnabled) {
|
if (root.areTestNetworksEnabled) {
|
||||||
baseUrl = Constants.networkExplorerLinks.goerliArbiscan
|
baseUrl = Constants.networkExplorerLinks.goerliArbiscan
|
||||||
}
|
}
|
||||||
Global.openLink("%1/address/%2".arg(baseUrl).arg(d.visibleAddress ? d.visibleAddress : root.ens))
|
Global.openLink("%1/%2/%3".arg(baseUrl).arg(Constants.networkExplorerLinks.addressPath).arg(d.visibleAddress ? d.visibleAddress : root.ens))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StatusAction {
|
StatusAction {
|
||||||
|
@ -199,7 +199,7 @@ StatusListItem {
|
||||||
if (root.areTestNetworksEnabled) {
|
if (root.areTestNetworksEnabled) {
|
||||||
baseUrl = Constants.networkExplorerLinks.goerliOptimistic
|
baseUrl = Constants.networkExplorerLinks.goerliOptimistic
|
||||||
}
|
}
|
||||||
Global.openLink("%1/address/%2".arg(baseUrl).arg(d.visibleAddress ? d.visibleAddress : root.ens))
|
Global.openLink("%1/%2/%3".arg(baseUrl).arg(Constants.networkExplorerLinks.addressPath).arg(d.visibleAddress ? d.visibleAddress : root.ens))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StatusMenuSeparator { }
|
StatusMenuSeparator { }
|
||||||
|
|
|
@ -19,6 +19,7 @@ StatusMenu {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property var contactsStore
|
property var contactsStore
|
||||||
|
property bool areTestNetworksEnabled: false
|
||||||
|
|
||||||
signal openSendModal(address: string)
|
signal openSendModal(address: string)
|
||||||
|
|
||||||
|
@ -42,8 +43,6 @@ StatusMenu {
|
||||||
|
|
||||||
property string contractName: ""
|
property string contractName: ""
|
||||||
|
|
||||||
property bool isGoerliTestnet: false
|
|
||||||
|
|
||||||
property int addressType: TransactionAddressMenu.AddressType.Address
|
property int addressType: TransactionAddressMenu.AddressType.Address
|
||||||
|
|
||||||
function getViewText(target) {
|
function getViewText(target) {
|
||||||
|
@ -68,11 +67,9 @@ StatusMenu {
|
||||||
function refreshShowOnActionsVisiblity(shortChainName) {
|
function refreshShowOnActionsVisiblity(shortChainName) {
|
||||||
switch(shortChainName.toLowerCase()) {
|
switch(shortChainName.toLowerCase()) {
|
||||||
case Constants.networkShortChainNames.arbiscan.toLowerCase():
|
case Constants.networkShortChainNames.arbiscan.toLowerCase():
|
||||||
case Constants.networkShortChainNames.goerliArbiscan.toLowerCase():
|
|
||||||
showOnArbiscanAction.enabled = true
|
showOnArbiscanAction.enabled = true
|
||||||
break
|
break
|
||||||
case Constants.networkShortChainNames.optimism.toLowerCase():
|
case Constants.networkShortChainNames.optimism.toLowerCase():
|
||||||
case Constants.networkShortChainNames.goerliOptimism.toLowerCase():
|
|
||||||
showOnOptimismAction.enabled = true
|
showOnOptimismAction.enabled = true
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
|
@ -81,19 +78,6 @@ StatusMenu {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshIsTestnet(shortChainName) {
|
|
||||||
switch(shortChainName.toLowerCase()) {
|
|
||||||
case Constants.networkShortChainNames.goerliMainnet.toLowerCase():
|
|
||||||
case Constants.networkShortChainNames.goerliArbiscan.toLowerCase():
|
|
||||||
case Constants.networkShortChainNames.goerliOptimism.toLowerCase():
|
|
||||||
d.isGoerliTestnet = true
|
|
||||||
return
|
|
||||||
default:
|
|
||||||
d.isGoerliTestnet = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function openMenu(delegate) {
|
function openMenu(delegate) {
|
||||||
const x = delegate.width - 40
|
const x = delegate.width - 40
|
||||||
const y = delegate.height / 2 + 20
|
const y = delegate.height / 2 + 20
|
||||||
|
@ -147,7 +131,6 @@ StatusMenu {
|
||||||
d.addressName = contactData.isContact ? contactData.name : WalletStores.RootStore.getNameForAddress(address)
|
d.addressName = contactData.isContact ? contactData.name : WalletStores.RootStore.getNameForAddress(address)
|
||||||
d.addressEns = RootStore.getEnsForSavedWalletAddress(address)
|
d.addressEns = RootStore.getEnsForSavedWalletAddress(address)
|
||||||
d.addressChains = RootStore.getChainShortNamesForSavedWalletAddress(address)
|
d.addressChains = RootStore.getChainShortNamesForSavedWalletAddress(address)
|
||||||
d.refreshIsTestnet(chainShortName)
|
|
||||||
|
|
||||||
showOnEtherscanAction.enabled = true
|
showOnEtherscanAction.enabled = true
|
||||||
showOnArbiscanAction.enabled = address.includes(Constants.networkShortChainNames.arbiscan + ":")
|
showOnArbiscanAction.enabled = address.includes(Constants.networkShortChainNames.arbiscan + ":")
|
||||||
|
@ -164,7 +147,6 @@ StatusMenu {
|
||||||
d.addressType = TransactionAddressMenu.AddressType.Tx
|
d.addressType = TransactionAddressMenu.AddressType.Tx
|
||||||
d.selectedAddress = address
|
d.selectedAddress = address
|
||||||
d.refreshShowOnActionsVisiblity(chainShortName)
|
d.refreshShowOnActionsVisiblity(chainShortName)
|
||||||
d.refreshIsTestnet(chainShortName)
|
|
||||||
d.openMenu(delegate)
|
d.openMenu(delegate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +155,6 @@ StatusMenu {
|
||||||
d.contractName = name
|
d.contractName = name
|
||||||
d.selectedAddress = address
|
d.selectedAddress = address
|
||||||
d.refreshShowOnActionsVisiblity(chainShortName)
|
d.refreshShowOnActionsVisiblity(chainShortName)
|
||||||
d.refreshIsTestnet(chainShortName)
|
|
||||||
d.openMenu(delegate)
|
d.openMenu(delegate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +167,6 @@ StatusMenu {
|
||||||
onClosed: {
|
onClosed: {
|
||||||
d.addressType = TransactionAddressMenu.AddressType.Address
|
d.addressType = TransactionAddressMenu.AddressType.Address
|
||||||
d.contractName = ""
|
d.contractName = ""
|
||||||
d.isGoerliTestnet = false
|
|
||||||
|
|
||||||
showOnEtherscanAction.enabled = false
|
showOnEtherscanAction.enabled = false
|
||||||
showOnArbiscanAction.enabled = false
|
showOnArbiscanAction.enabled = false
|
||||||
|
@ -207,8 +187,8 @@ StatusMenu {
|
||||||
text: d.getViewText(qsTr("Etherscan"))
|
text: d.getViewText(qsTr("Etherscan"))
|
||||||
icon.name: "link"
|
icon.name: "link"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
const type = d.addressType === TransactionAddressMenu.Tx ? "tx" : "address"
|
const type = d.addressType === TransactionAddressMenu.Tx ? Constants.networkExplorerLinks.txPath : Constants.networkExplorerLinks.addressPath
|
||||||
const link = d.isGoerliTestnet ? Constants.networkExplorerLinks.goerliEtherscan : Constants.networkExplorerLinks.etherscan
|
const link = areTestNetworksEnabled ? Constants.networkExplorerLinks.goerliEtherscan : Constants.networkExplorerLinks.etherscan
|
||||||
Global.openLink("%1/%2/%3".arg(link).arg(type).arg(d.selectedAddress))
|
Global.openLink("%1/%2/%3".arg(link).arg(type).arg(d.selectedAddress))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,8 +198,8 @@ StatusMenu {
|
||||||
text: d.getViewText(qsTr("Arbiscan"))
|
text: d.getViewText(qsTr("Arbiscan"))
|
||||||
icon.name: "link"
|
icon.name: "link"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
const type = d.addressType === TransactionAddressMenu.Tx ? "tx" : "address"
|
const type = d.addressType === TransactionAddressMenu.Tx ? Constants.networkExplorerLinks.txPath : Constants.networkExplorerLinks.addressPath
|
||||||
const link = d.isGoerliTestnet ? Constants.networkExplorerLinks.goerliArbiscan : Constants.networkExplorerLinks.arbiscan
|
const link = areTestNetworksEnabled ? Constants.networkExplorerLinks.goerliArbiscan : Constants.networkExplorerLinks.arbiscan
|
||||||
Global.openLink("%1/%2/%3".arg(link).arg(type).arg(d.selectedAddress))
|
Global.openLink("%1/%2/%3".arg(link).arg(type).arg(d.selectedAddress))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,8 +209,8 @@ StatusMenu {
|
||||||
text: d.getViewText(qsTr("Optimism Explorer"))
|
text: d.getViewText(qsTr("Optimism Explorer"))
|
||||||
icon.name: "link"
|
icon.name: "link"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
const type = d.addressType === TransactionAddressMenu.Tx ? "tx" : "address"
|
const type = d.addressType === TransactionAddressMenu.Tx ? Constants.networkExplorerLinks.txPath : Constants.networkExplorerLinks.addressPath
|
||||||
const link = d.isGoerliTestnet ? Constants.networkExplorerLinks.goerliOptimistic : Constants.networkExplorerLinks.optimistic
|
const link = areTestNetworksEnabled ? Constants.networkExplorerLinks.goerliOptimistic : Constants.networkExplorerLinks.optimistic
|
||||||
Global.openLink("%1/%2/%3".arg(link).arg(type).arg(d.selectedAddress))
|
Global.openLink("%1/%2/%3".arg(link).arg(type).arg(d.selectedAddress))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,8 +207,10 @@ Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.topMargin: Style.current.halfPadding
|
Layout.topMargin: Style.current.halfPadding
|
||||||
|
currentIndex: -1
|
||||||
// ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
highlightRangeMode: ListView.ApplyRange
|
||||||
|
preferredHighlightBegin: 0
|
||||||
|
preferredHighlightEnd: height - (footerOverlayed ? footerItem.height : 0)
|
||||||
|
|
||||||
readonly property Item firstItem: count > 0 ? itemAtIndex(0) : null
|
readonly property Item firstItem: count > 0 ? itemAtIndex(0) : null
|
||||||
|
|
||||||
|
@ -217,6 +219,10 @@ Rectangle {
|
||||||
readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests
|
readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests
|
||||||
width: ListView.view.width - Style.current.padding * 2
|
width: ListView.view.width - Style.current.padding * 2
|
||||||
highlighted: root.currentAddress.toLowerCase() === model.address.toLowerCase()
|
highlighted: root.currentAddress.toLowerCase() === model.address.toLowerCase()
|
||||||
|
onHighlightedChanged: {
|
||||||
|
if (highlighted)
|
||||||
|
ListView.view.currentIndex = index
|
||||||
|
}
|
||||||
anchors.horizontalCenter: !!parent ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: !!parent ? parent.horizontalCenter : undefined
|
||||||
title: model.name
|
title: model.name
|
||||||
subTitle: LocaleUtils.currencyAmountToLocaleString(model.currencyBalance)
|
subTitle: LocaleUtils.currencyAmountToLocaleString(model.currencyBalance)
|
||||||
|
@ -281,6 +287,7 @@ Rectangle {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.showSavedAddresses = false
|
root.showSavedAddresses = false
|
||||||
|
walletAccountsListView.currentIndex = -1
|
||||||
root.selectAllAccounts()
|
root.selectAllAccounts()
|
||||||
}
|
}
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
@ -406,10 +413,8 @@ Rectangle {
|
||||||
|
|
||||||
model: SortFilterProxyModel {
|
model: SortFilterProxyModel {
|
||||||
sourceModel: RootStore.accounts
|
sourceModel: RootStore.accounts
|
||||||
|
|
||||||
sorters: RoleSorter { roleName: "position"; sortOrder: Qt.AscendingOrder }
|
sorters: RoleSorter { roleName: "position"; sortOrder: Qt.AscendingOrder }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -678,6 +678,7 @@ Item {
|
||||||
TransactionAddressMenu {
|
TransactionAddressMenu {
|
||||||
id: addressMenu
|
id: addressMenu
|
||||||
|
|
||||||
|
areTestNetworksEnabled: WalletStores.RootStore.areTestNetworksEnabled
|
||||||
contactsStore: root.contactsStore
|
contactsStore: root.contactsStore
|
||||||
onOpenSendModal: (address) => root.sendModal.open(address)
|
onOpenSendModal: (address) => root.sendModal.open(address)
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,8 @@ QtObject {
|
||||||
property var historyTransactions: Global.appIsReady? walletSection.activityController.model : null
|
property var historyTransactions: Global.appIsReady? walletSection.activityController.model : null
|
||||||
readonly property bool loadingHistoryTransactions: Global.appIsReady && walletSection.activityController.status.loadingData
|
readonly property bool loadingHistoryTransactions: Global.appIsReady && walletSection.activityController.status.loadingData
|
||||||
readonly property bool newDataAvailable: Global.appIsReady && walletSection.activityController.status.newDataAvailable
|
readonly property bool newDataAvailable: Global.appIsReady && walletSection.activityController.status.newDataAvailable
|
||||||
readonly property bool isTransactionFilterDirty: Global.appIsReady && walletSection.activityController.status.isFilterDirty
|
readonly property var transactionActivityStatus: Global.appIsReady ? walletSection.activityController.status : null
|
||||||
|
|
||||||
property bool isNonArchivalNode: history ? history.isNonArchivalNode
|
property bool isNonArchivalNode: history ? history.isNonArchivalNode
|
||||||
: false
|
: false
|
||||||
property var marketValueStore: TokenMarketValuesStore{}
|
property var marketValueStore: TokenMarketValuesStore{}
|
||||||
|
@ -188,7 +189,7 @@ QtObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTransactionFilter() {
|
function updateTransactionFilter() {
|
||||||
if (isTransactionFilterDirty)
|
if (transactionActivityStatus.isFilterDirty)
|
||||||
walletSection.activityController.updateFilter()
|
walletSection.activityController.updateFilter()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,15 +31,15 @@ ColumnLayout {
|
||||||
signal launchTransactionDetail(var transaction)
|
signal launchTransactionDetail(var transaction)
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible && RootStore.isTransactionFilterDirty) {
|
if (visible && RootStore.transactionActivityStatus.isFilterDirty) {
|
||||||
WalletStores.RootStore.currentActivityFiltersStore.applyAllFilters()
|
WalletStores.RootStore.currentActivityFiltersStore.applyAllFilters()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: RootStore
|
target: RootStore.transactionActivityStatus
|
||||||
enabled: root.visible
|
enabled: root.visible
|
||||||
function onIsTransactionFilterDirtyChanged() {
|
function onIsFilterDirtyChanged() {
|
||||||
RootStore.updateTransactionFilter()
|
RootStore.updateTransactionFilter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -829,9 +829,6 @@ QtObject {
|
||||||
readonly property string mainnet: "eth"
|
readonly property string mainnet: "eth"
|
||||||
readonly property string arbiscan: "arb"
|
readonly property string arbiscan: "arb"
|
||||||
readonly property string optimism: "opt"
|
readonly property string optimism: "opt"
|
||||||
readonly property string goerliMainnet: "goEth"
|
|
||||||
readonly property string goerliArbiscan: "goArb"
|
|
||||||
readonly property string goerliOptimism: "goOpt"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property QtObject networkExplorerLinks: QtObject {
|
readonly property QtObject networkExplorerLinks: QtObject {
|
||||||
|
@ -841,6 +838,9 @@ QtObject {
|
||||||
readonly property string goerliEtherscan: "https://goerli.etherscan.io"
|
readonly property string goerliEtherscan: "https://goerli.etherscan.io"
|
||||||
readonly property string goerliArbiscan: "https://goerli.arbiscan.io"
|
readonly property string goerliArbiscan: "https://goerli.arbiscan.io"
|
||||||
readonly property string goerliOptimistic: "https://goerli-optimism.etherscan.io"
|
readonly property string goerliOptimistic: "https://goerli-optimism.etherscan.io"
|
||||||
|
|
||||||
|
readonly property string addressPath: "address"
|
||||||
|
readonly property string txPath: "tx"
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property string api_request: "api-request"
|
readonly property string api_request: "api-request"
|
||||||
|
|
Loading…
Reference in New Issue