mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 14:26:34 +00:00
fix(activity_center): wait for chats before fetching ac notifs
This commit is contained in:
parent
1e5fee981e
commit
1e8ab03f18
@ -46,6 +46,11 @@ proc updateActivityGroupCounters*(self: Controller) =
|
||||
self.delegate.setActivityGroupCounters(counters)
|
||||
|
||||
proc init*(self: Controller) =
|
||||
self.events.once(chat_service.SIGNAL_CHANNEL_GROUPS_LOADED) do(e:Args):
|
||||
# Only fectch activity center notification once channel groups are loaded,
|
||||
# since we need the chats to associate the notifications to
|
||||
self.activity_center_service.asyncActivityNotificationLoad()
|
||||
|
||||
self.events.on(activity_center_service.SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_LOADED) do(e: Args):
|
||||
let args = ActivityCenterNotificationsArgs(e)
|
||||
self.delegate.addActivityCenterNotifications(args.activityCenterNotifications)
|
||||
|
@ -406,9 +406,6 @@ proc getChatDetailsForChatTypes*(self: Controller, types: seq[ChatType]): seq[Ch
|
||||
proc chatsWithCategoryHaveUnreadMessages*(self: Controller, communityId: string, categoryId: string): bool =
|
||||
return self.chatService.chatsWithCategoryHaveUnreadMessages(communityId, categoryId)
|
||||
|
||||
proc getCommunityDetails*(self: Controller, communityId: string): CommunityDto =
|
||||
return self.communityService.getCommunityById(communityId)
|
||||
|
||||
proc getCommunityCategoryDetails*(self: Controller, communityId: string, categoryId: string): Category =
|
||||
return self.communityService.getCategoryById(communityId, categoryId)
|
||||
|
||||
|
@ -119,7 +119,6 @@ QtObject:
|
||||
self.events.emit(SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_COUNT_MAY_HAVE_CHANGED, Args())
|
||||
|
||||
proc init*(self: Service) =
|
||||
self.asyncActivityNotificationLoad()
|
||||
self.events.on(SignalType.Message.event) do(e: Args):
|
||||
let receivedData = MessageSignal(e)
|
||||
if (receivedData.activityCenterNotifications.len > 0):
|
||||
|
Loading…
x
Reference in New Issue
Block a user