chuckya/app
Daniel Sockwell 8758221e73
Fix frontend crash when deleting announcements ()
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
..
chewy Fix needlessly indexing unsearchable statuses into ElasticSearch () 2019-10-02 20:04:46 +02:00
controllers Add option to include resolved DNS records when blacklisting e-mail domains in admin UI () 2020-03-12 22:35:20 +01:00
helpers Add ability to delete files uploaded for settings in admin UI () 2020-03-08 16:00:24 +01:00
javascript Fix frontend crash when deleting announcements () 2020-03-21 03:10:42 +01:00
lib Bump cld3 from 3.2.6 to 3.3.0 () 2020-03-09 00:12:52 +01:00
mailers Fix error when sending moderation notification () 2020-02-01 15:42:12 +01:00
models Fix reported accounts not being whitelisted when resolving a spamcheck report () 2020-03-21 03:08:09 +01:00
policies Add ability to delete files uploaded for settings in admin UI () 2020-03-08 16:00:24 +01:00
presenters Fix n+1 query for bookmarks on statuses () 2019-11-28 04:08:00 +01:00
serializers Change local media attachments to perform heavy processing asynchronously () 2020-03-08 23:56:18 +01:00
services Fix some timeouts when searching URLs by limiting some database queries () 2020-03-12 23:06:43 +01:00
validators Search account domain in lowercase () 2020-02-01 15:42:24 +01:00
views Add option to include resolved DNS records when blacklisting e-mail domains in admin UI () 2020-03-12 22:35:20 +01:00
workers Change local media attachments to perform heavy processing asynchronously () 2020-03-08 23:56:18 +01:00