Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/app/AppLayouts/Wallet/WalletLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Item {
root.resetView()
RootStore.setFillterAllAddresses()
}
onCurrentAddressChanged: root.resetView()
onShowSavedAddressesChanged: {
if(showSavedAddresses)
rightPanelStackView.replace(cmpSavedAddresses)
Expand Down
6 changes: 4 additions & 2 deletions ui/app/AppLayouts/Wallet/panels/ActivityFilterPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Column {
property var activityFilterStore
property var store
property bool isLoading: false
property bool hideNoResults: false

spacing: 12

Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions ui/app/AppLayouts/Wallet/stores/ActivityFiltersStore.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down Expand Up @@ -146,15 +146,15 @@ QtObject {
applyTimeRange()
}

function applyTimeRange() {
function applyTimeRange(callUpdate = true) {
const startTimestamp = d.fromTimestampNoLimit
? activityController.noLimitTimestamp
: fromTimestamp/1000
const endTimestamp = d.toTimestampNoLimit
? activityController.noLimitTimestamp
: toTimestamp/1000
activityController.setFilterTime(startTimestamp, endTimestamp)
if (autoUpdateFilter)
if (autoUpdateFilter && callUpdate)
activityController.updateFilter()
}

Expand Down Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions ui/imports/shared/views/HistoryView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
}
Expand Down