mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-18 01:27:25 +00:00
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.chainIds = chainIds
|
||||||
self.status.setIsFilterDirty(true)
|
self.status.setIsFilterDirty(true)
|
||||||
|
|
||||||
|
self.status.emitFilterChainsChanged()
|
||||||
self.updateAssetsIdentities()
|
self.updateAssetsIdentities()
|
||||||
|
|
||||||
proc updateRecipientsModel*(self: Controller) {.slot.} =
|
proc updateRecipientsModel*(self: Controller) {.slot.} =
|
||||||
self.status.setLoadingRecipients(true)
|
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:
|
if res.error != nil or res.result.kind != JBool:
|
||||||
self.status.setLoadingRecipients(false)
|
self.status.setLoadingRecipients(false)
|
||||||
error "error fetching recipients: ", res.error, "; kind ", res.result.kind
|
error "error fetching recipients: ", res.error, "; kind ", res.result.kind
|
||||||
@ -381,7 +382,7 @@ QtObject:
|
|||||||
|
|
||||||
proc loadMoreRecipients(self: Controller) {.slot.} =
|
proc loadMoreRecipients(self: Controller) {.slot.} =
|
||||||
self.status.setLoadingRecipients(true)
|
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:
|
if res.error != nil:
|
||||||
self.status.setLoadingRecipients(false)
|
self.status.setLoadingRecipients(false)
|
||||||
error "error fetching more recipient entries: ", res.error
|
error "error fetching more recipient entries: ", res.error
|
||||||
|
@ -27,6 +27,11 @@ QtObject:
|
|||||||
proc delete*(self: Status) =
|
proc delete*(self: Status) =
|
||||||
self.QObject.delete
|
self.QObject.delete
|
||||||
|
|
||||||
|
proc filterChainsChanged*(self: Status) {.signal.}
|
||||||
|
|
||||||
|
proc emitFilterChainsChanged*(self: Status) =
|
||||||
|
self.filterChainsChanged()
|
||||||
|
|
||||||
proc loadingDataChanged*(self: Status) {.signal.}
|
proc loadingDataChanged*(self: Status) {.signal.}
|
||||||
|
|
||||||
proc setLoadingData*(self: Status, loadingData: bool) =
|
proc setLoadingData*(self: Status, loadingData: bool) =
|
||||||
|
@ -507,6 +507,8 @@ proc fromJson*(e: JsonNode, T: typedesc[GetRecipientsResponse]): GetRecipientsRe
|
|||||||
|
|
||||||
rpc(getRecipientsAsync, "wallet"):
|
rpc(getRecipientsAsync, "wallet"):
|
||||||
requestId: int32
|
requestId: int32
|
||||||
|
chainIDs: seq[int]
|
||||||
|
addresses: seq[string]
|
||||||
offset: int
|
offset: int
|
||||||
limit: int
|
limit: int
|
||||||
|
|
||||||
|
@ -47,6 +47,8 @@ ColumnLayout {
|
|||||||
if (RootStore.transactionActivityStatus.isFilterDirty) {
|
if (RootStore.transactionActivityStatus.isFilterDirty) {
|
||||||
WalletStores.RootStore.currentActivityFiltersStore.applyAllFilters()
|
WalletStores.RootStore.currentActivityFiltersStore.applyAllFilters()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WalletStores.RootStore.currentActivityFiltersStore.updateRecipientsModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
@ -55,6 +57,9 @@ ColumnLayout {
|
|||||||
function onIsFilterDirtyChanged() {
|
function onIsFilterDirtyChanged() {
|
||||||
RootStore.updateTransactionFilter()
|
RootStore.updateTransactionFilter()
|
||||||
}
|
}
|
||||||
|
function onFilterChainsChanged() {
|
||||||
|
WalletStores.RootStore.currentActivityFiltersStore.updateRecipientsModel()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
2
vendor/status-go
vendored
2
vendor/status-go
vendored
@ -1 +1 @@
|
|||||||
Subproject commit bd6f9b098b018aba59d89d40343e4aee09e0531e
|
Subproject commit cff96f99e0997b3f3197eecf7b568f7c2e42cac1
|
Loading…
x
Reference in New Issue
Block a user