From 8e2530ea16332f389edaeba7e87d7447c077bb00 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Thu, 19 Nov 2020 08:40:18 -0800 Subject: [PATCH] Mark correctly as read reverse-order announcements (#15070) This fixes a bug in #15065 where the "read" indicator was not getting correctly set. The ID of a dismissed announcement is now correct. --- .../features/getting_started/components/announcements.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/getting_started/components/announcements.js b/app/javascript/mastodon/features/getting_started/components/announcements.js index d53bd8055c3..5bc3abac665 100644 --- a/app/javascript/mastodon/features/getting_started/components/announcements.js +++ b/app/javascript/mastodon/features/getting_started/components/announcements.js @@ -396,7 +396,7 @@ class Announcements extends ImmutablePureComponent { _markAnnouncementAsRead () { const { dismissAnnouncement, announcements } = this.props; const { index } = this.state; - const announcement = announcements.get(index); + const announcement = announcements.get(announcements.size - 1 - index); if (!announcement.get('read')) dismissAnnouncement(announcement.get('id')); }