bastodon/app/javascript/mastodon
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
..
actions Fix regression in “Edit media” modal in web UI (#13243) 2020-03-10 11:59:44 +01:00
components Fix WebUI crash in single-column mode on prehistoric browsers (#13267) 2020-03-17 20:43:55 +01:00
containers Change the string "hidden" to "blocked" in WebUI (#13221) 2020-03-09 09:13:21 +01:00
features Fix frontend crash when deleting announcements (#13283) 2020-03-21 03:10:42 +01:00
locales Change the string "hidden" to "blocked" in WebUI (#13221) 2020-03-09 09:13:21 +01:00
middleware
reducers Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
selectors Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
service_worker Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
storage
store Code style improvements in JavaScript (#13159) 2020-03-08 16:02:36 +01:00
utils Fix shortNumberFormat to within 3 chars without units (#12706) 2019-12-29 16:59:25 +01:00
api.js
base_polyfills.js Fix old browsers crashing because of missing finally polyfill in web UI (#13115) 2020-02-18 17:22:44 +01:00
common.js
compare_id.js
extra_polyfills.js fix multiple space (#12655) 2019-12-19 07:39:08 +09:00
initial_state.js Add setting for whether to crop images in unexpanded toots (#12126) 2019-10-24 22:51:41 +02:00
is_mobile.js
load_keyboard_extensions.js fix: support KaiOS arrow navigation on public pages (#12251) 2019-11-04 13:03:09 +01:00
load_polyfills.js Fix old browsers crashing because of missing finally polyfill in web UI (#13115) 2020-02-18 17:22:44 +01:00
main.js Fix /web redirecting to /web/web in web UI (#13128) 2020-02-22 01:27:34 +01:00
performance.js
ready.js
rtl.js
scroll.js
settings.js
stream.js minor server-sent events fixes (#12945) 2020-01-24 20:51:33 +01:00
test_setup.js
uuid.js