diff --git a/packages/pl-fe/src/actions/notifications.ts b/packages/pl-fe/src/actions/notifications.ts index a1ca22390..7731a91f8 100644 --- a/packages/pl-fe/src/actions/notifications.ts +++ b/packages/pl-fe/src/actions/notifications.ts @@ -1,5 +1,4 @@ import IntlMessageFormat from 'intl-messageformat'; - import 'intl-pluralrules'; import { defineMessages } from 'react-intl'; diff --git a/packages/pl-fe/src/features/notifications/components/notification.tsx b/packages/pl-fe/src/features/notifications/components/notification.tsx index 3b924aefa..359457574 100644 --- a/packages/pl-fe/src/features/notifications/components/notification.tsx +++ b/packages/pl-fe/src/features/notifications/components/notification.tsx @@ -19,7 +19,7 @@ import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch'; import { useAppSelector } from 'pl-fe/hooks/use-app-selector'; import { useInstance } from 'pl-fe/hooks/use-instance'; import { useLoggedIn } from 'pl-fe/hooks/use-logged-in'; -import { makeGetNotification, SelectedNotification } from 'pl-fe/selectors'; +import { makeGetNotification } from 'pl-fe/selectors'; import { useModalsStore } from 'pl-fe/stores/modals'; import { useSettingsStore } from 'pl-fe/stores/settings'; import { NotificationType } from 'pl-fe/utils/notification'; @@ -188,7 +188,7 @@ interface INotification { onReblog?: (status: StatusEntity, e?: KeyboardEvent) => void; } -const getNotificationStatus = (n: SelectedNotification) => { +const getNotificationStatus = (n: Pick & ({ status: StatusEntity } | { })) => { if (['mention', 'status', 'reblog', 'favourite', 'poll', 'update', 'emoji_reaction', 'event_reminder', 'participation_accepted', 'participation_request'].includes(n.type)) // @ts-ignore return n.status; diff --git a/packages/pl-fe/src/reducers/notifications.ts b/packages/pl-fe/src/reducers/notifications.ts index 3c4b63792..799185c98 100644 --- a/packages/pl-fe/src/reducers/notifications.ts +++ b/packages/pl-fe/src/reducers/notifications.ts @@ -30,7 +30,7 @@ import type { Notification as BaseNotification, Markers, NotificationGroup, Pagi import type { AnyAction } from 'redux'; const QueuedNotificationRecord = ImmutableRecord({ - notification: {} as any as NotificationGroup, + notification: {} as any as BaseNotification, intlMessages: {} as Record, intlLocale: '', }); @@ -175,7 +175,7 @@ const deleteByStatus = (state: State, statusId: string) => // @ts-ignore state.update('items', map => map.filterNot(item => item !== null && item.status === statusId)); -const updateNotificationsQueue = (state: State, notification: NotificationGroup, intlMessages: Record, intlLocale: string) => { +const updateNotificationsQueue = (state: State, notification: BaseNotification, intlMessages: Record, intlLocale: string) => { const queuedNotifications = state.queuedNotifications; const listedNotifications = state.items; const totalQueuedNotificationsCount = state.totalQueuedNotificationsCount; diff --git a/packages/pl-fe/src/selectors/index.ts b/packages/pl-fe/src/selectors/index.ts index 1375c0381..e2acb9ca8 100644 --- a/packages/pl-fe/src/selectors/index.ts +++ b/packages/pl-fe/src/selectors/index.ts @@ -185,7 +185,9 @@ const makeGetNotification = () => createSelector([ (state: RootState, notification: NotificationGroup) => selectAccounts(state, notification.sample_account_ids), ], (notification, target, status, accounts): SelectedNotification => ({ ...notification, + // @ts-ignore target, + // @ts-ignore status, accounts, }));