pl-fe: remove obsolete code

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-27 18:27:40 +02:00
parent 3af6b5894e
commit 4bc1ca107f

View file

@ -21,8 +21,6 @@ import type { MinifiedStatus } from 'pl-fe/reducers/statuses';
import type { MRFSimple } from 'pl-fe/schemas/pleroma'; import type { MRFSimple } from 'pl-fe/schemas/pleroma';
import type { RootState } from 'pl-fe/store'; 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) => const selectAccount = (state: RootState, accountId: string) =>
state.entities[Entities.ACCOUNTS]?.store[accountId] as Account | undefined; state.entities[Entities.ACCOUNTS]?.store[accountId] as Account | undefined;
@ -179,12 +177,12 @@ type SelectedStatus = Exclude<ReturnType<ReturnType<typeof makeGetStatus>>, null
const makeGetNotification = () => createSelector([ const makeGetNotification = () => createSelector([
(_state: RootState, notification: MinifiedNotification) => notification, (_state: RootState, notification: MinifiedNotification) => notification,
// @ts-ignore // @ts-ignore
(state: RootState, notification: MinifiedNotification) => selectAccount(state, normalizeId(notification.account_id)), (state: RootState, notification: MinifiedNotification) => selectAccount(state, notification.account_id),
// @ts-ignore // @ts-ignore
(state: RootState, notification: MinifiedNotification) => selectAccount(state, normalizeId(notification.target_id)), (state: RootState, notification: MinifiedNotification) => selectAccount(state, notification.target_id),
// @ts-ignore // @ts-ignore
(state: RootState, notification: MinifiedNotification) => state.statuses.get(normalizeId(notification.status_id)), (state: RootState, notification: MinifiedNotification) => state.statuses.get(notification.status_id),
(state: RootState, notification: MinifiedNotification) => notification.account_ids ? selectAccounts(state, notification.account_ids?.map(normalizeId)) : null, (state: RootState, notification: MinifiedNotification) => notification.account_ids ? selectAccounts(state, notification.account_ids) : null,
], (notification, account, target, status, accounts): Notification => ({ ], (notification, account, target, status, accounts): Notification => ({
...notification, ...notification,
// @ts-ignore // @ts-ignore