1
0
REI-Fixed/app/javascript/mastodon/features
Daniel Sockwell 8758221e73
Fix frontend crash when deleting announcements (#13283)
This two-line change fixes a crash in the front end that occurred
under the following circumstances:
 *  A server had more than one announcement,
 *  A user was displaying the announcements, and
 *  An announcement was deleted (or unpublished, which amounts to
    the same thing.)

As might be expected, the bug was caused by attempting to access a
notification using an index value outside the bounds of the existing
announcements.  Specifically, in two places.  First,
`_markAnnouncementAsRead` attempts to modify announcements based on
the current index.  This is what caused the front end crash.  Second,
when rendering the `Announcements` component, the code paginates the
announcements and displays the current one.  This did not cause a
crash, but caused the front end to confusingly display a blank
announcement (in situations that would have caused a crash) with no
way for the user to navigate back to previous announcements.

This commit fixes both issues by adding a check to ensure that the
code never attempts to access an announcement with an index greater
than or equal to the number of announcements present.
2020-03-21 03:10:42 +01:00
..
account/components Change the string "hidden" to "blocked" in WebUI (#13221) 2020-03-09 09:13:21 +01:00
account_gallery Add noopener and/or noreferrer (#12202) 2019-10-24 22:44:42 +02:00
account_timeline Add “account timeline” filter category (#12918) 2020-01-23 21:32:00 +01:00
audio Add tooltips to audio/video player buttons (#13203) 2020-03-05 15:52:15 +01:00
blocks Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
bookmarked_statuses Add bookmarks (#7107) 2019-11-13 23:02:10 +01:00
community_timeline Fix unread toot indicator not honoring onlyMedia in public and community timelines (#12330) 2019-11-11 00:05:02 +02:00
compose Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
direct_timeline Fix conversations not having an unread indicator in web UI (#12506) 2019-12-01 07:06:20 +01:00
directory Fix unfollow confirmations in account directory (#12922) 2020-01-22 16:26:47 +01:00
domain_blocks Change the string "hidden" to "blocked" in WebUI (#13221) 2020-03-09 09:13:21 +01:00
emoji Fix emoji search not showing custom emoji when none are uncategorized (#11920) 2019-09-23 00:48:43 +02:00
favourited_statuses Fix scroll to top in single column UI (#11463) 2019-08-01 19:17:17 +02:00
favourites Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
follow_requests Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
followers Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
following Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
generic_not_found Fix performance of home feed regeneration (#12084) 2019-10-06 22:11:17 +02:00
getting_started Fix frontend crash when deleting announcements (#13283) 2020-03-21 03:10:42 +01:00
hashtag_timeline Bump react-select from 2.4.4 to 3.0.5 (#11930) 2019-10-22 01:31:27 +09:00
home_timeline Change how unread announcements are handled (#13020) 2020-02-03 01:53:09 +01:00
introduction change "finish tutorial" text to "finish toot-orial" (#9905) 2019-02-04 04:45:29 +01:00
keyboard_shortcuts Add hotkey for opening media files (#12498) 2019-11-29 17:02:35 +01:00
list_adder Refactor icons in web UI to use Icon component (#9951) 2019-02-01 00:14:05 +01:00
list_editor Disable list title validation button when list title is empty (#11475) 2019-08-03 19:10:39 +02:00
list_timeline Fix scroll to top in single column UI (#11463) 2019-08-01 19:17:17 +02:00
lists Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
mutes Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
notifications Add follow_request notification type (#12198) 2019-12-01 17:25:29 +01:00
pinned_statuses Fix scroll to top in single column UI (#11463) 2019-08-01 19:17:17 +02:00
public_timeline Fix unread toot indicator not honoring onlyMedia in public and community timelines (#12330) 2019-11-11 00:05:02 +02:00
reblogs Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
report Add blurhash (#10630) 2019-04-27 03:24:09 +02:00
search Add responsive panels to the single-column layout (#10820) 2019-05-25 21:27:00 +02:00
standalone Disable real-time updates on public pages to improve readability (#10260) 2019-03-18 18:34:56 +01:00
status Fix detailed view of direct messages displaying a 0 boost count (#13244) 2020-03-10 18:39:47 +01:00
ui Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
video Add tooltips to audio/video player buttons (#13203) 2020-03-05 15:52:15 +01:00