From f46374fdac8c2909cc0561a01aedde81072cb742 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 25 Jun 2023 12:26:48 -0500 Subject: [PATCH] Simplify makeGetAccount further --- app/soapbox/selectors/index.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/app/soapbox/selectors/index.ts b/app/soapbox/selectors/index.ts index 58fca52ca..5d6fccefc 100644 --- a/app/soapbox/selectors/index.ts +++ b/app/soapbox/selectors/index.ts @@ -23,23 +23,12 @@ const normalizeId = (id: any): string => typeof id === 'string' ? id : ''; const getAccountBase = (state: RootState, id: string) => state.accounts.get(id); const getAccountRelationship = (state: RootState, id: string) => state.relationships.get(id); -const getAccountMoved = (state: RootState, id: string) => state.accounts.get(state.accounts.get(id)?.moved || ''); -const getAccountMeta = (state: RootState, id: string) => state.accounts_meta.get(id); -const getAccountAdminData = (state: RootState, id: string) => state.admin.users.get(id); -const getAccountPatron = (state: RootState, id: string) => { - const url = state.accounts.get(id)?.url; - return url ? state.patron.accounts.get(url) : null; -}; export const makeGetAccount = () => { return createSelector([ getAccountBase, getAccountRelationship, - getAccountMoved, - getAccountMeta, - getAccountAdminData, - getAccountPatron, - ], (base, relationship, moved, meta, admin, patron) => { + ], (base, relationship) => { if (!base) return null; base.relationship = base.relationship ?? relationship; return base;