fix(@wallet): inifinite load tx

fixes #9960
This commit is contained in:
Anthony Laibe 2023-03-22 18:10:05 +01:00 committed by Anthony Laibe
parent 964aa7ebc9
commit 9af1734c6a
4 changed files with 12 additions and 1 deletions

View File

@ -62,7 +62,7 @@ proc init*(self: Controller) =
self.events.on(SIGNAL_HISTORY_ERROR) do (e:Args):
let accounts = self.getWalletAccounts()
let addresses = accounts.map(account => account.address)
self.delegate.setHistoryFetchState(addresses, isFetching = false)
self.delegate.setHistoryFetchState(addresses, isFetching = false, hasMore = false)
self.events.on(SIGNAL_TRANSACTIONS_LOADED) do(e:Args):
let args = TransactionsLoadedArgs(e)

View File

@ -35,6 +35,9 @@ method setTrxHistoryResult*(self: AccessInterface, transactions: seq[Transaction
method setHistoryFetchState*(self: AccessInterface, addresses: seq[string], isFetching: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method setHistoryFetchState*(self: AccessInterface, addresses: seq[string], isFetching: bool, hasMore: bool) {.base.} =
raise newException(ValueError, "No implementation available")
method setHistoryFetchState*(self: AccessInterface, address: string, allTxLoaded: bool, isFetching: bool) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -140,9 +140,13 @@ method setTrxHistoryResult*(self: Module, transactions: seq[TransactionDto], col
method setHistoryFetchState*(self: Module, addresses: seq[string], isFetching: bool) =
self.view.setHistoryFetchStateForAccounts(addresses, isFetching)
method setHistoryFetchState*(self: Module, addresses: seq[string], isFetching: bool, hasMore: bool) =
self.view.setHistoryFetchStateForAccounts(addresses, isFetching, hasMore)
method setHistoryFetchState*(self: Module, address: string, allTxLoaded: bool, isFetching: bool) =
self.view.setHistoryFetchState(address, allTxLoaded, isFetching)
method setIsNonArchivalNode*(self: Module, isNonArchivalNode: bool) =
self.view.setIsNonArchivalNode(isNonArchivalNode)

View File

@ -87,6 +87,10 @@ QtObject:
else:
self.setHistoryFetchState(address, allTxLoaded = false, isFetching)
proc setHistoryFetchStateForAccounts*(self: View, addresses: seq[string], isFetching: bool, hasMore: bool) =
for address in addresses:
self.setHistoryFetchState(address, allTxLoaded = not hasMore, isFetching)
proc setModel*(self: View, address: string) {.slot.} =
if not self.models.hasKey(address):
self.models[address] = newModel()