[Glitch] Fix notification screen crashing in rare cases where the status no longer exists

Port 0d85a79f19 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Renaud Chaput
2024-08-14 08:47:15 +02:00
committed by Claire
parent cf96857038
commit 524fc8563b
5 changed files with 15 additions and 9 deletions

View File

@@ -47,7 +47,7 @@ function dispatchAssociatedRecords(
fetchedAccounts.push(notification.moderation_warning.target_account);
}
if ('status' in notification) {
if ('status' in notification && notification.status) {
fetchedStatuses.push(notification.status);
}
});
@@ -119,7 +119,7 @@ export const processNewNotificationForGroups = createAppAsyncThunk(
if (
(notification.type === 'mention' || notification.type === 'update') &&
notification.status.filtered
notification.status?.filtered
) {
const filters = notification.status.filtered.filter((result) =>
result.filter.context.includes('notifications'),