pl-fe: Remove unused code
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
d0a036c63c
commit
1badb61abe
2 changed files with 0 additions and 100 deletions
|
@ -236,42 +236,6 @@ const expandNotifications = ({ maxId }: Record<string, any> = {}, 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<string, Account>; statuses: Record<string, Status> });
|
||||
|
||||
// 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 });
|
||||
|
|
|
@ -59,70 +59,6 @@ const comparator = (a: Pick<NotificationGroup, 'group_key'>, b: Pick<Notificatio
|
|||
return 0;
|
||||
};
|
||||
|
||||
// const minifyNotification = (notification: Notification) => {
|
||||
// // @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<typeof minifyNotification>;
|
||||
|
||||
// Count how many notifications appear after the given ID (for unread count)
|
||||
const countFuture = (notifications: ImmutableOrderedMap<string, NotificationGroup>, lastId: string | number) =>
|
||||
notifications.reduce((acc, notification) => {
|
||||
|
|
Loading…
Reference in a new issue