pl-fe: remove obsolete code
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
3af6b5894e
commit
4bc1ca107f
1 changed files with 4 additions and 6 deletions
|
@ -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<ReturnType<ReturnType<typeof makeGetStatus>>, 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
|
||||
|
|
Loading…
Reference in a new issue