mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-24 01:08:08 +01:00
8758221e73
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. |
||
---|---|---|
.. | ||
account/components | ||
account_gallery | ||
account_timeline | ||
audio | ||
blocks | ||
bookmarked_statuses | ||
community_timeline | ||
compose | ||
direct_timeline | ||
directory | ||
domain_blocks | ||
emoji | ||
favourited_statuses | ||
favourites | ||
follow_requests | ||
followers | ||
following | ||
generic_not_found | ||
getting_started | ||
hashtag_timeline | ||
home_timeline | ||
introduction | ||
keyboard_shortcuts | ||
list_adder | ||
list_editor | ||
list_timeline | ||
lists | ||
mutes | ||
notifications | ||
pinned_statuses | ||
public_timeline | ||
reblogs | ||
report | ||
search | ||
standalone | ||
status | ||
ui | ||
video |