feat(@desktop/wallet): Refresh recipients model (#12298)
This commit is contained in:
parent
7cb1746c84
commit
7d852c3565
|
@ -365,11 +365,12 @@ QtObject:
|
|||
self.chainIds = chainIds
|
||||
self.status.setIsFilterDirty(true)
|
||||
|
||||
self.status.emitFilterChainsChanged()
|
||||
self.updateAssetsIdentities()
|
||||
|
||||
proc updateRecipientsModel*(self: Controller) {.slot.} =
|
||||
self.status.setLoadingRecipients(true)
|
||||
let res = backend_activity.getRecipientsAsync(self.requestId, 0, FETCH_RECIPIENTS_BATCH_COUNT_DEFAULT)
|
||||
let res = backend_activity.getRecipientsAsync(self.requestId, self.chainIds, self.addresses, 0, FETCH_RECIPIENTS_BATCH_COUNT_DEFAULT)
|
||||
if res.error != nil or res.result.kind != JBool:
|
||||
self.status.setLoadingRecipients(false)
|
||||
error "error fetching recipients: ", res.error, "; kind ", res.result.kind
|
||||
|
@ -381,7 +382,7 @@ QtObject:
|
|||
|
||||
proc loadMoreRecipients(self: Controller) {.slot.} =
|
||||
self.status.setLoadingRecipients(true)
|
||||
let res = backend_activity.getRecipientsAsync(self.requestId, self.recipientsModel.getCount(), FETCH_RECIPIENTS_BATCH_COUNT_DEFAULT)
|
||||
let res = backend_activity.getRecipientsAsync(self.requestId, self.chainIds, self.addresses, self.recipientsModel.getCount(), FETCH_RECIPIENTS_BATCH_COUNT_DEFAULT)
|
||||
if res.error != nil:
|
||||
self.status.setLoadingRecipients(false)
|
||||
error "error fetching more recipient entries: ", res.error
|
||||
|
|
|
@ -27,6 +27,11 @@ QtObject:
|
|||
proc delete*(self: Status) =
|
||||
self.QObject.delete
|
||||
|
||||
proc filterChainsChanged*(self: Status) {.signal.}
|
||||
|
||||
proc emitFilterChainsChanged*(self: Status) =
|
||||
self.filterChainsChanged()
|
||||
|
||||
proc loadingDataChanged*(self: Status) {.signal.}
|
||||
|
||||
proc setLoadingData*(self: Status, loadingData: bool) =
|
||||
|
|
|
@ -507,6 +507,8 @@ proc fromJson*(e: JsonNode, T: typedesc[GetRecipientsResponse]): GetRecipientsRe
|
|||
|
||||
rpc(getRecipientsAsync, "wallet"):
|
||||
requestId: int32
|
||||
chainIDs: seq[int]
|
||||
addresses: seq[string]
|
||||
offset: int
|
||||
limit: int
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@ ColumnLayout {
|
|||
if (RootStore.transactionActivityStatus.isFilterDirty) {
|
||||
WalletStores.RootStore.currentActivityFiltersStore.applyAllFilters()
|
||||
}
|
||||
|
||||
WalletStores.RootStore.currentActivityFiltersStore.updateRecipientsModel()
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
@ -55,6 +57,9 @@ ColumnLayout {
|
|||
function onIsFilterDirtyChanged() {
|
||||
RootStore.updateTransactionFilter()
|
||||
}
|
||||
function onFilterChainsChanged() {
|
||||
WalletStores.RootStore.currentActivityFiltersStore.updateRecipientsModel()
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit bd6f9b098b018aba59d89d40343e4aee09e0531e
|
||||
Subproject commit cff96f99e0997b3f3197eecf7b568f7c2e42cac1
|
Loading…
Reference in New Issue