From 4bc1ca107f1aed41faf9b332bacd38bc005c6798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 27 Sep 2024 18:27:40 +0200 Subject: [PATCH] pl-fe: remove obsolete code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/selectors/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/pl-fe/src/selectors/index.ts b/packages/pl-fe/src/selectors/index.ts index 490e43f476..f8440f8a41 100644 --- a/packages/pl-fe/src/selectors/index.ts +++ b/packages/pl-fe/src/selectors/index.ts @@ -21,8 +21,6 @@ import type { MinifiedStatus } from 'pl-fe/reducers/statuses'; import type { MRFSimple } from 'pl-fe/schemas/pleroma'; import type { RootState } from 'pl-fe/store'; -const normalizeId = (id: any): string => typeof id === 'string' ? id : typeof id === 'object' ? normalizeId(id.id) : ''; - const selectAccount = (state: RootState, accountId: string) => state.entities[Entities.ACCOUNTS]?.store[accountId] as Account | undefined; @@ -179,12 +177,12 @@ type SelectedStatus = Exclude>, null const makeGetNotification = () => createSelector([ (_state: RootState, notification: MinifiedNotification) => notification, // @ts-ignore - (state: RootState, notification: MinifiedNotification) => selectAccount(state, normalizeId(notification.account_id)), + (state: RootState, notification: MinifiedNotification) => selectAccount(state, notification.account_id), // @ts-ignore - (state: RootState, notification: MinifiedNotification) => selectAccount(state, normalizeId(notification.target_id)), + (state: RootState, notification: MinifiedNotification) => selectAccount(state, notification.target_id), // @ts-ignore - (state: RootState, notification: MinifiedNotification) => state.statuses.get(normalizeId(notification.status_id)), - (state: RootState, notification: MinifiedNotification) => notification.account_ids ? selectAccounts(state, notification.account_ids?.map(normalizeId)) : null, + (state: RootState, notification: MinifiedNotification) => state.statuses.get(notification.status_id), + (state: RootState, notification: MinifiedNotification) => notification.account_ids ? selectAccounts(state, notification.account_ids) : null, ], (notification, account, target, status, accounts): Notification => ({ ...notification, // @ts-ignore