diff --git a/packages/pl-fe/src/actions/notifications.ts b/packages/pl-fe/src/actions/notifications.ts index 7731a91f8..ea862b9f5 100644 --- a/packages/pl-fe/src/actions/notifications.ts +++ b/packages/pl-fe/src/actions/notifications.ts @@ -236,42 +236,6 @@ const expandNotifications = ({ maxId }: Record = {}, done: () => an dispatch(expandNotificationsFail(error)); done(); }); - - // return getClient(state).notifications.getNotifications(params, { signal: abortExpandNotifications.signal }).then(response => { - // const entries = (response.items).reduce((acc, item) => { - // if (item.account?.id) { - // acc.accounts[item.account.id] = item.account; - // } - - // // Used by Move notification - // if (item.type === 'move' && item.target.id) { - // acc.accounts[item.target.id] = item.target; - // } - - // // TODO actually check for type - // // @ts-ignore - // if (item.status?.id) { - // // @ts-ignore - // acc.statuses[item.status.id] = item.status; - // } - - // return acc; - // }, { accounts: {}, statuses: {} } as { accounts: Record; statuses: Record }); - - // dispatch(importEntities({ - // accounts: Object.values(entries.accounts), - // statuses: Object.values(entries.statuses), - // })); - - // const deduplicatedNotifications = normalizeNotifications(response.items, state.notifications.items); - - // dispatch(expandNotificationsSuccess(deduplicatedNotifications, response.next)); - // fetchRelatedRelationships(dispatch, response.items); - // done(); - // }).catch(error => { - // dispatch(expandNotificationsFail(error)); - // done(); - // }); }; const expandNotificationsRequest = () => ({ type: NOTIFICATIONS_EXPAND_REQUEST }); diff --git a/packages/pl-fe/src/reducers/notifications.ts b/packages/pl-fe/src/reducers/notifications.ts index 799185c98..6d027a6be 100644 --- a/packages/pl-fe/src/reducers/notifications.ts +++ b/packages/pl-fe/src/reducers/notifications.ts @@ -59,70 +59,6 @@ const comparator = (a: Pick, b: Pick { -// // @ts-ignore -// const minifiedNotification: { -// duplicate: boolean; -// account_id: string; -// account_ids: string[]; -// created_at: string; -// id: string; -// } & ( -// | { type: 'follow' | 'follow_request' | 'admin.sign_up' | 'bite' } -// | { -// type: 'mention' | 'status' | 'reblog' | 'favourite' | 'poll' | 'update' | 'event_reminder'; -// status_id: string; -// } -// | { -// type: 'admin.report'; -// report: Report; -// } -// | { -// type: 'severed_relationships'; -// relationship_severance_event: RelationshipSeveranceEvent; -// } -// | { -// type: 'moderation_warning'; -// moderation_warning: AccountWarning; -// } -// | { -// type: 'move'; -// target_id: string; -// } -// | { -// type: 'emoji_reaction'; -// emoji: string; -// emoji_url: string | null; -// status_id: string; -// } -// | { -// type: 'chat_mention'; -// chat_message_id: string; -// } -// | { -// type: 'participation_accepted' | 'participation_request'; -// status_id: string; -// participation_message: string | null; -// } -// ) = { -// ...omit(notification, ['account', 'accounts']), -// created_at: notification.latest_page_notification_at, -// id: notification.id, -// type: notification.type, -// }; - -// // @ts-ignore -// if (notification.status) minifiedNotification.status_id = notification.status.id; -// // @ts-ignore -// if (notification.target) minifiedNotification.target_id = notification.target.id; -// // @ts-ignore -// if (notification.chat_message) minifiedNotification.chat_message_id = notification.chat_message.id; - -// return minifiedNotification; -// }; - -// type MinifiedNotification = ReturnType; - // Count how many notifications appear after the given ID (for unread count) const countFuture = (notifications: ImmutableOrderedMap, lastId: string | number) => notifications.reduce((acc, notification) => {