diff --git a/packages/pl-fe/src/actions/admin.ts b/packages/pl-fe/src/actions/admin.ts index 9f6f3ff8c..4be3d0741 100644 --- a/packages/pl-fe/src/actions/admin.ts +++ b/packages/pl-fe/src/actions/admin.ts @@ -5,7 +5,7 @@ import { filterBadges, getTagDiff } from 'pl-fe/utils/badges'; import { deleteFromTimelines } from './timelines'; -import type { Account, AdminGetAccountsParams, AdminGetReportsParams, PleromaConfig } from 'pl-api'; +import type { Account, AdminGetAccountsParams, AdminGetReportsParams, PleromaConfig, Status } from 'pl-api'; import type { AppDispatch, RootState } from 'pl-fe/store'; const ADMIN_CONFIG_FETCH_REQUEST = 'ADMIN_CONFIG_FETCH_REQUEST' as const; @@ -109,13 +109,18 @@ const fetchReports = (params?: AdminGetReportsParams) => return getClient(state).admin.reports.getReports(params) .then(({ items }) => { + const accounts: Array = []; + const statuses: Array = []; + items.forEach((report) => { - const accounts = []; if (report.account?.account) accounts.push(report.account.account); if (report.target_account?.account) accounts.push(report.target_account.account); - importEntities({ accounts, statuses: report.statuses }); + statuses.push(...report.statuses as Array); + dispatch({ type: ADMIN_REPORTS_FETCH_SUCCESS, reports: items, params }); }); + + importEntities({ accounts, statuses }); }).catch(error => { dispatch({ type: ADMIN_REPORTS_FETCH_FAIL, error, params }); }); diff --git a/packages/pl-fe/src/components/scrollable-list.tsx b/packages/pl-fe/src/components/scrollable-list.tsx index 7aa8b5b10..edaf7e1af 100644 --- a/packages/pl-fe/src/components/scrollable-list.tsx +++ b/packages/pl-fe/src/components/scrollable-list.tsx @@ -185,7 +185,7 @@ const ScrollableList = React.forwardRef, IScrollableList & position: 'relative', }} > - {!showLoading && data.length ? ( + {(!showLoading || showPlaceholder) && data.length ? ( <> {prepend} {virtualItems.map((item) => ( diff --git a/packages/pl-fe/src/features/notifications/index.tsx b/packages/pl-fe/src/features/notifications/index.tsx index d72436344..3df7e3042 100644 --- a/packages/pl-fe/src/features/notifications/index.tsx +++ b/packages/pl-fe/src/features/notifications/index.tsx @@ -129,8 +129,8 @@ const Notifications = () => { const scrollContainer = ( { - if (!statuses[status.id] || status.account || !statuses[status.id].account) statuses[status.id] = status; + if (status.account) { + statuses[status.id] = status; + processAccount(status.account); + } - if (status.account) processAccount(status.account); if (status.quote) processStatus(status.quote); if (status.reblog) processStatus(status.reblog); if (status.poll) polls[status.poll.id] = status.poll;