diff --git a/packages/pl-hooks/lib/importer.ts b/packages/pl-hooks/lib/importer.ts index 845735798..ec9d94b3a 100644 --- a/packages/pl-hooks/lib/importer.ts +++ b/packages/pl-hooks/lib/importer.ts @@ -1,6 +1,6 @@ import { queryClient } from 'pl-hooks/contexts/query-client'; -import { type DeduplicatedNotification, type NormalizedNotification, normalizeNotification } from './normalizers/notification'; +import { type DeduplicatedNotification, getNotificationStatus, type NormalizedNotification, normalizeNotification } from './normalizers/notification'; import { type NormalizedStatus, normalizeStatus } from './normalizers/status'; import type { @@ -70,9 +70,9 @@ const importEntities = (entities: { processAccount(notification.account); if (notification.type === 'move') processAccount(notification.target); - if (['mention', 'status', 'reblog', 'favourite', 'poll', 'update', 'emoji_reaction', 'event_reminder', 'participation_accepted', 'participation_request'].includes(notification.type)) { - // @ts-ignore - processStatus(notification.status); + const status = getNotificationStatus(notification); + if (status) { + processStatus(status); } }; diff --git a/packages/pl-hooks/lib/normalizers/notification.ts b/packages/pl-hooks/lib/normalizers/notification.ts index 3299778e7..d89cc2b90 100644 --- a/packages/pl-hooks/lib/normalizers/notification.ts +++ b/packages/pl-hooks/lib/normalizers/notification.ts @@ -126,4 +126,4 @@ const normalizeNotification = (notification: BaseNotification | DeduplicatedNoti type NormalizedNotification = ReturnType; -export { deduplicateNotifications, normalizeNotification, type DeduplicatedNotification, type NormalizedNotification }; +export { deduplicateNotifications, getNotificationStatus, normalizeNotification, type DeduplicatedNotification, type NormalizedNotification };