diff --git a/app/javascript/mastodon/actions/notification_groups.ts b/app/javascript/mastodon/actions/notification_groups.ts index 6d2f00ece8..8fc2f0d726 100644 --- a/app/javascript/mastodon/actions/notification_groups.ts +++ b/app/javascript/mastodon/actions/notification_groups.ts @@ -88,7 +88,7 @@ function dispatchAssociatedRecords( fetchedStatuses.push(notification.status); } - if ('collection' in notification) { + if ('collection' in notification && notification.collection) { collections.push(notification.collection); } }); diff --git a/app/javascript/mastodon/api_types/notifications.ts b/app/javascript/mastodon/api_types/notifications.ts index 4836c37e6a..a06aab7884 100644 --- a/app/javascript/mastodon/api_types/notifications.ts +++ b/app/javascript/mastodon/api_types/notifications.ts @@ -90,22 +90,22 @@ interface ReportNotificationJSON extends BaseNotificationJSON { interface AddedToCollectionNotificationGroupJSON extends BaseNotificationGroupJSON { type: 'added_to_collection'; - collection: ApiCollectionJSON; + collection: ApiCollectionJSON | null; } interface AddedToCollectionNotificationJSON extends BaseNotificationJSON { type: 'added_to_collection'; - collection: ApiCollectionJSON; + collection: ApiCollectionJSON | null; } interface CollectionUpdateNotificationGroupJSON extends BaseNotificationGroupJSON { type: 'collection_update'; - collection: ApiCollectionJSON; + collection: ApiCollectionJSON | null; } interface CollectionUpdateNotificationJSON extends BaseNotificationJSON { type: 'collection_update'; - collection: ApiCollectionJSON; + collection: ApiCollectionJSON | null; } type SimpleNotificationTypes = 'follow' | 'follow_request' | 'admin.sign_up';