pl-hooks: remove duplicate code
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
f310fdcf6e
commit
49b4f87534
2 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { queryClient } from 'pl-hooks/contexts/query-client';
|
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 NormalizedStatus, normalizeStatus } from './normalizers/status';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
@ -70,9 +70,9 @@ const importEntities = (entities: {
|
||||||
processAccount(notification.account);
|
processAccount(notification.account);
|
||||||
if (notification.type === 'move') processAccount(notification.target);
|
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)) {
|
const status = getNotificationStatus(notification);
|
||||||
// @ts-ignore
|
if (status) {
|
||||||
processStatus(notification.status);
|
processStatus(status);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -126,4 +126,4 @@ const normalizeNotification = (notification: BaseNotification | DeduplicatedNoti
|
||||||
|
|
||||||
type NormalizedNotification = ReturnType<typeof normalizeNotification>;
|
type NormalizedNotification = ReturnType<typeof normalizeNotification>;
|
||||||
|
|
||||||
export { deduplicateNotifications, normalizeNotification, type DeduplicatedNotification, type NormalizedNotification };
|
export { deduplicateNotifications, getNotificationStatus, normalizeNotification, type DeduplicatedNotification, type NormalizedNotification };
|
||||||
|
|
Loading…
Reference in a new issue