Change how unread announcements are handled (#13020)

* Change meaning of /api/v1/announcements/:id/dismiss to mark an announcement as read

* Change how unread announcements are counted in UI

* Add unread marker to announcements and mark announcements as unread as they are displayed

* Fixups
This commit is contained in:
ThibG authored and GitHub committed 2020-02-03 01:53:09 +01:00
1 parent 61a7390b66
commit 3adc722d1c
8 files changed
+94 -29

No files matched your search

@@ -19,11 +19,7 @@ class Api::V1::AnnouncementsController < Api::BaseController
def set_announcements
@announcements = begin
scope = Announcement.published
scope.merge!(Announcement.without_muted(current_account)) unless truthy_param?(:with_dismissed)
scope.chronological
Announcement.published.chronological
end
end