Skip to content

Commit

Permalink
Fix for hashgraph#307 issue (Navigating back from Transaction details…
Browse files Browse the repository at this point in the history
… to Account details does not preserve pagination). (hashgraph#308)

Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>

Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
  • Loading branch information
ericleponner authored and Neurone committed May 18, 2023
1 parent 742ec53 commit 738e81e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/transaction/TransactionTableControllerXL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ export class TransactionTableControllerXL extends TableController<Transaction, s
pageParamName, keyParamName);
this.accountId = accountId
this.accountIdMandatory = accountIdMandatory
this.watchAndReload([this.transactionType, this.accountId])
this.watchAndReload([this.transactionType])
// this.accountId cannot be treated as this.transactionType :
// when this.accountId changes, we don't want to move to auto-refresh mode.
watch(this.accountId, () => {
if (this.mounted.value) {
this.unmount()
this.mount()
}
})
}

public readonly transactionType: Ref<string> = ref("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe("TransactionTableController.ts", () => {
accountId.value = "0.0.4" // Value is unimportant
await flushPromises()
expect(tc.pageSize.value).toBe(PAGE_SIZE)
expect(tc.autoRefresh.value).toBe(true)
expect(tc.autoRefresh.value).toBe(false)
expect(tc.autoStopped.value).toBe(false)
expect(tc.currentPage.value).toBe(1)
expect(tc.loading.value).toBe(false)
Expand Down

0 comments on commit 738e81e

Please sign in to comment.