about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/home_timeline
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-02-03 01:53:09 +0100
committerGitHub <noreply@github.com>2020-02-03 01:53:09 +0100
commit3adc722d1cdd28d87d2724b8952d7ec52d241b52 (patch)
treef8b08e38d3fba35c92b21b14c99ec2c3d21dd3c6 /app/javascript/mastodon/features/home_timeline
parent61a7390b666dc40beda291da426436a9d36f4288 (diff)
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
Diffstat (limited to 'app/javascript/mastodon/features/home_timeline')
-rw-r--r--app/javascript/mastodon/features/home_timeline/index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/home_timeline/index.js b/app/javascript/mastodon/features/home_timeline/index.js
index 2bad22bc1..577ff33bb 100644
--- a/app/javascript/mastodon/features/home_timeline/index.js
+++ b/app/javascript/mastodon/features/home_timeline/index.js
@@ -24,7 +24,7 @@ const mapStateToProps = state => ({
   hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0,
   isPartial: state.getIn(['timelines', 'home', 'isPartial']),
   hasAnnouncements: !state.getIn(['announcements', 'items']).isEmpty(),
-  unreadAnnouncements: state.getIn(['announcements', 'unread']).size,
+  unreadAnnouncements: state.getIn(['announcements', 'items']).count(item => !item.get('read')),
   showAnnouncements: state.getIn(['announcements', 'show']),
 });