Merge remote-tracking branch 'origin/develop' into compose-safe

environments/review-compose-sa-0lryjs/deployments/3555
Alex Gleason 1 year ago
commit 32990fa77b
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -7,6 +7,7 @@ import {
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import { getSettings } from 'soapbox/actions/settings'; import { getSettings } from 'soapbox/actions/settings';
import { Entities } from 'soapbox/entity-store/entities';
import { getDomain } from 'soapbox/utils/accounts'; import { getDomain } from 'soapbox/utils/accounts';
import { validId } from 'soapbox/utils/auth'; import { validId } from 'soapbox/utils/auth';
import ConfigDB from 'soapbox/utils/config-db'; import ConfigDB from 'soapbox/utils/config-db';
@ -16,21 +17,20 @@ import { shouldFilter } from 'soapbox/utils/timelines';
import type { ContextType } from 'soapbox/normalizers/filter'; import type { ContextType } from 'soapbox/normalizers/filter';
import type { ReducerChat } from 'soapbox/reducers/chats'; import type { ReducerChat } from 'soapbox/reducers/chats';
import type { RootState } from 'soapbox/store'; import type { RootState } from 'soapbox/store';
import type { Filter as FilterEntity, Notification, Status } from 'soapbox/types/entities'; import type { Account, Filter as FilterEntity, Notification, Status } from 'soapbox/types/entities';
const normalizeId = (id: any): string => typeof id === 'string' ? id : ''; const normalizeId = (id: any): string => typeof id === 'string' ? id : '';
const getAccountBase = (state: RootState, id: string) => state.accounts.get(id); const getAccountBase = (state: RootState, id: string) => state.entities[Entities.ACCOUNTS]?.store[id] as Account | undefined;
const getAccountRelationship = (state: RootState, id: string) => state.relationships.get(id); const getAccountRelationship = (state: RootState, id: string) => state.relationships.get(id);
export const makeGetAccount = () => { export const makeGetAccount = () => {
return createSelector([ return createSelector([
getAccountBase, getAccountBase,
getAccountRelationship, getAccountRelationship,
], (base, relationship) => { ], (account, relationship) => {
if (!base) return null; if (!account) return null;
base.relationship = base.relationship ?? relationship; return { ...account, relationship };
return base;
}); });
}; };

Loading…
Cancel
Save