[Glitch] Fix missing null check when importing collections from notifications
Port c08d13a65cc0434bb3c9d1c0e9ff03640cf77526 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
69e4aeca07
commit
8cf1947d4a
@ -88,7 +88,7 @@ function dispatchAssociatedRecords(
|
|||||||
fetchedStatuses.push(notification.status);
|
fetchedStatuses.push(notification.status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('collection' in notification) {
|
if ('collection' in notification && notification.collection) {
|
||||||
collections.push(notification.collection);
|
collections.push(notification.collection);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -90,22 +90,22 @@ interface ReportNotificationJSON extends BaseNotificationJSON {
|
|||||||
|
|
||||||
interface AddedToCollectionNotificationGroupJSON extends BaseNotificationGroupJSON {
|
interface AddedToCollectionNotificationGroupJSON extends BaseNotificationGroupJSON {
|
||||||
type: 'added_to_collection';
|
type: 'added_to_collection';
|
||||||
collection: ApiCollectionJSON;
|
collection: ApiCollectionJSON | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AddedToCollectionNotificationJSON extends BaseNotificationJSON {
|
interface AddedToCollectionNotificationJSON extends BaseNotificationJSON {
|
||||||
type: 'added_to_collection';
|
type: 'added_to_collection';
|
||||||
collection: ApiCollectionJSON;
|
collection: ApiCollectionJSON | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CollectionUpdateNotificationGroupJSON extends BaseNotificationGroupJSON {
|
interface CollectionUpdateNotificationGroupJSON extends BaseNotificationGroupJSON {
|
||||||
type: 'collection_update';
|
type: 'collection_update';
|
||||||
collection: ApiCollectionJSON;
|
collection: ApiCollectionJSON | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CollectionUpdateNotificationJSON extends BaseNotificationJSON {
|
interface CollectionUpdateNotificationJSON extends BaseNotificationJSON {
|
||||||
type: 'collection_update';
|
type: 'collection_update';
|
||||||
collection: ApiCollectionJSON;
|
collection: ApiCollectionJSON | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
type SimpleNotificationTypes = 'follow' | 'follow_request' | 'admin.sign_up';
|
type SimpleNotificationTypes = 'follow' | 'follow_request' | 'admin.sign_up';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user