-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ActivityCenter): Simplify and fix AC notifications read/unread states #12753
fix(ActivityCenter): Simplify and fix AC notifications read/unread states #12753
Conversation
Jenkins BuildsClick to see older builds (7)
|
397239e
to
12fc931
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job. It's way cleaner!
@@ -54,36 +54,32 @@ proc init*(self: Controller) = | |||
self.events.on(activity_center_service.SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_LOADED) do(e: Args): | |||
let args = ActivityCenterNotificationsArgs(e) | |||
self.delegate.addActivityCenterNotifications(args.activityCenterNotifications) | |||
self.delegate.hasUnseenActivityCenterNotificationsChanged() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the module could call this signal on itself instead of the controller doing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed (others also)
if (evArgs.notificationIds.len > 0): | ||
self.delegate.markActivityCenterNotificationReadDone(evArgs.notificationIds) | ||
self.delegate.unreadActivityCenterNotificationsCountChanged() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing here
if (evArgs.notificationIds.len > 0): | ||
self.delegate.markActivityCenterNotificationUnreadDone(evArgs.notificationIds) | ||
self.delegate.unreadActivityCenterNotificationsCountChanged() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
|
||
self.events.on(activity_center_service.SIGNAL_ACTIVITY_CENTER_MARK_ALL_NOTIFICATIONS_AS_READ) do(e: Args): | ||
self.delegate.markAllActivityCenterNotificationsReadDone() | ||
self.delegate.unreadActivityCenterNotificationsCountChanged() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
fabbcb8
to
7178455
Compare
7178455
to
cd661be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much cleaner indeed! 👍
Always happy to see more code removed than added 😄
self.events.emit(SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_COUNT_MAY_HAVE_CHANGED, Args()) | ||
let notificationIds = @[notificationId] | ||
discard backend.markActivityCenterNotificationsRead(notificationIds) | ||
self.events.emit(SIGNAL_ACTIVITY_CENTER_MARK_NOTIFICATIONS_AS_READ, ActivityCenterNotificationIdsArgs(notificationIds: notificationIds)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly are the cases when we still need to emit SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_COUNT_MAY_HAVE_CHANGED
? You removed it in a few places, but it's still there sometimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were extra calls, but its still needed
Close #12619
What does the PR do
Mark all read
marks ALL notifications as read (it's how it's implemented in status-go)Mark all read
Affected areas
Activity center
Screenshot of functionality (including design for comparison)
Screen.Recording.2023-11-16.at.14.35.23.mov