fix: ensure contact data is refetched when changes where made
Changes in contact data caused via calls to any contact related APIs wouldn't be reflected in the UI because it doesn't re-fetch the updated state from status-go. This commit makes the contactsService `fetchContacts` API public so it can be used on the profile section control to re-fetch contact data when changes to contacts have been emitted.
This commit is contained in:
parent
f4a33036e6
commit
338c7854b0
|
@ -34,18 +34,22 @@ method delete*[T](self: Controller[T]) =
|
|||
|
||||
method init*[T](self: Controller[T]) =
|
||||
self.events.on("contactAdded") do(e: Args):
|
||||
self.contactsService.fetchContacts()
|
||||
let contacts = self.getContacts()
|
||||
self.delegate.setContactList(contacts)
|
||||
|
||||
self.events.on("contactBlocked") do(e: Args):
|
||||
self.contactsService.fetchContacts()
|
||||
let contacts = self.getContacts()
|
||||
self.delegate.setContactList(contacts)
|
||||
|
||||
self.events.on("contactUnblocked") do(e: Args):
|
||||
self.contactsService.fetchContacts()
|
||||
let contacts = self.getContacts()
|
||||
self.delegate.setContactList(contacts)
|
||||
|
||||
self.events.on("contactRemoved") do(e: Args):
|
||||
self.contactsService.fetchContacts()
|
||||
let contacts = self.getContacts()
|
||||
self.delegate.setContactList(contacts)
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ QtObject:
|
|||
result.threadpool = threadpool
|
||||
result.contacts = initTable[string, ContactsDto]()
|
||||
|
||||
proc fetchContacts(self: Service) =
|
||||
proc fetchContacts*(self: Service) =
|
||||
try:
|
||||
let response = status_contacts.getContacts()
|
||||
|
||||
|
|
Loading…
Reference in New Issue