bug(@desktop/wallet): Fix new transaction button visuals (#12589)

* Fixed duplicated wallet activity fetch request
* Fixed not resetting tab on wallet account add
This commit is contained in:
Cuteivist 2023-11-14 11:35:18 +01:00 committed by GitHub
parent 69783e173b
commit 90cfc0842a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 6 deletions

View File

@ -113,6 +113,7 @@ Item {
root.resetView()
RootStore.setFillterAllAddresses()
}
onCurrentAddressChanged: root.resetView()
onShowSavedAddressesChanged: {
if(showSavedAddresses)
rightPanelStackView.replace(cmpSavedAddresses)

View File

@ -18,6 +18,7 @@ Column {
property var activityFilterStore
property var store
property bool isLoading: false
property bool hideNoResults: false
spacing: 12
@ -212,14 +213,15 @@ Column {
}
Separator {
visible: noResultsAfterFilter.visible
visible: noResultsAfterFilter.noResults
}
StatusBaseText {
id: noResultsAfterFilter
readonly property bool noResults: !root.isLoading && activityFilterStore.transactionsList.count === 0 && activityFilterStore.filtersSet
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 16
visible: !root.isLoading && activityFilterStore.transactionsList.count === 0 && activityFilterStore.filtersSet
visible: !root.hideNoResults && noResults
text: qsTr("No activity items for the current filter")
font.pixelSize: Style.current.primaryTextFontSize
color: Theme.palette.baseColor1

View File

@ -12,7 +12,7 @@ QtObject {
property bool autoUpdateFilter: true
property var activityController: walletSection.activityController
property bool filtersSet: selectedTime !== Constants.TransactionTimePeriod.All ||
readonly property bool filtersSet: selectedTime !== Constants.TransactionTimePeriod.All ||
typeFilters.length !== 0 ||
statusFilters.length !== 0 ||
tokensFilter.length !== 0 ||
@ -146,7 +146,7 @@ QtObject {
applyTimeRange()
}
function applyTimeRange() {
function applyTimeRange(callUpdate = true) {
const startTimestamp = d.fromTimestampNoLimit
? activityController.noLimitTimestamp
: fromTimestamp/1000
@ -154,7 +154,7 @@ QtObject {
? activityController.noLimitTimestamp
: toTimestamp/1000
activityController.setFilterTime(startTimestamp, endTimestamp)
if (autoUpdateFilter)
if (autoUpdateFilter && callUpdate)
activityController.updateFilter()
}
@ -259,7 +259,7 @@ QtObject {
}
function applyAllFilters() {
applyTimeRange()
applyTimeRange(false)
activityController.setFilterType(JSON.stringify(typeFilters))
activityController.setFilterStatus(JSON.stringify(statusFilters))
activityController.setFilterAssets(JSON.stringify(tokensFilter), false)

View File

@ -112,6 +112,7 @@ ColumnLayout {
visible: d.isInitialLoading || transactionListRoot.count > 0 || WalletStores.RootStore.currentActivityFiltersStore.filtersSet
activityFilterStore: WalletStores.RootStore.currentActivityFiltersStore
store: WalletStores.RootStore
hideNoResults: newTransactions.visible
isLoading: d.isInitialLoading
}
}
@ -277,6 +278,12 @@ ColumnLayout {
function onNewDataAvailableChanged() {
if (!d.lastRefreshTime || ((Date.now() - d.lastRefreshTime) > (1000 * d.maxSecondsBetweenRefresh))) {
// Show `New transactions` button only when filter is applied
if (!WalletStores.RootStore.currentActivityFiltersStore.filtersSet) {
d.refreshData()
return
}
newTransactions.visible = RootStore.newDataAvailable
return
}