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

fix: reset cursor when opening transaction history views #2060

Merged
merged 9 commits into from
Mar 27, 2024
5 changes: 5 additions & 0 deletions packages/core/src/controllers/TransactionsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const TransactionsController = {
SnackController.showError('Failed to fetch transactions')
state.loading = false
state.empty = true
state.next = undefined
}
},

Expand Down Expand Up @@ -125,6 +126,10 @@ export const TransactionsController = {
})
},

clearCursor() {
state.next = undefined
},

resetTransactions() {
state.transactions = []
state.transactionsByYear = {}
Expand Down
1 change: 1 addition & 0 deletions packages/scaffold/src/partials/w3m-activity-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class W3mActivityList extends LitElement {
// -- Lifecycle ----------------------------------------- //
public constructor() {
super()
TransactionsController.clearCursor()
this.unsubscribe.push(
...[
AccountController.subscribe(val => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class W3mOnRampActivityView extends LitElement {
})
]
)
TransactionsController.clearCursor()
this.fetchTransactions()
}

Expand Down