diff --git a/app/soapbox/selectors/index.ts b/app/soapbox/selectors/index.ts index 1c4e670f9..e00cca464 100644 --- a/app/soapbox/selectors/index.ts +++ b/app/soapbox/selectors/index.ts @@ -208,10 +208,8 @@ export const makeGetNotification = () => { export const getAccountGallery = createSelector([ (state: RootState, id: string) => state.timelines.get(`account:${id}:media`)?.items || ImmutableOrderedSet(), - (state: RootState) => state.statuses, - (state: RootState) => state.accounts, -], (statusIds, statuses, accounts) => { - + (state: RootState) => state.statuses, +], (statusIds, statuses) => { return statusIds.reduce((medias: ImmutableList, statusId: string) => { const status = statuses.get(statusId); if (!status) return medias; @@ -225,19 +223,14 @@ export const getAccountGallery = createSelector([ export const getGroupGallery = createSelector([ (state: RootState, id: string) => state.timelines.get(`group:${id}:media`)?.items || ImmutableOrderedSet(), (state: RootState) => state.statuses, - (state: RootState) => state.accounts, -], (statusIds, statuses, accounts) => { - +], (statusIds, statuses) => { return statusIds.reduce((medias: ImmutableList, statusId: string) => { const status = statuses.get(statusId); if (!status) return medias; if (status.reblog) return medias; - if (typeof status.account !== 'string') return medias; - - const account = accounts.get(status.account); return medias.concat( - status.media_attachments.map(media => media.merge({ status, account }))); + status.media_attachments.map(media => media.merge({ status, account: status.account }))); }, ImmutableList()); });