pl-hooks: remove duplicate code

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-29 17:05:21 +01:00
parent f310fdcf6e
commit 49b4f87534
2 changed files with 5 additions and 5 deletions

View file

@ -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);
}
};

View file

@ -126,4 +126,4 @@ const normalizeNotification = (notification: BaseNotification | DeduplicatedNoti
type NormalizedNotification = ReturnType<typeof normalizeNotification>;
export { deduplicateNotifications, normalizeNotification, type DeduplicatedNotification, type NormalizedNotification };
export { deduplicateNotifications, getNotificationStatus, normalizeNotification, type DeduplicatedNotification, type NormalizedNotification };