From 2a0d701fea8809a3f3220b84c056a67c9497afab Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 5 Jan 2024 14:53:17 -0600 Subject: [PATCH 1/2] features: enable Mastodon admin on Ditto --- src/utils/features.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/features.ts b/src/utils/features.ts index a89a5c86ed..66aa668543 100644 --- a/src/utils/features.ts +++ b/src/utils/features.ts @@ -682,6 +682,7 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/v1/admin/accounts/:account_id/approve */ mastodonAdmin: any([ + v.software === DITTO, v.software === MASTODON && gte(v.compatVersion, '2.9.1'), v.software === PLEROMA && v.build === REBASED && gte(v.version, '2.4.50'), ]), From 8009299df66a57eb7254f108d62cfa1be81761f8 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 5 Jan 2024 15:36:44 -0600 Subject: [PATCH 2/2] LatestAccountsPanel: don't hide unsorted admin accounts, removes legacy Pleroma hack --- .../admin/components/latest-accounts-panel.tsx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/features/admin/components/latest-accounts-panel.tsx b/src/features/admin/components/latest-accounts-panel.tsx index 619324e72e..0d3ce94c90 100644 --- a/src/features/admin/components/latest-accounts-panel.tsx +++ b/src/features/admin/components/latest-accounts-panel.tsx @@ -1,4 +1,4 @@ -import { OrderedSet as ImmutableOrderedSet, is } from 'immutable'; +import { OrderedSet as ImmutableOrderedSet } from 'immutable'; import React, { useEffect, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { useHistory } from 'react-router-dom'; @@ -7,8 +7,6 @@ import { fetchUsers } from 'soapbox/actions/admin'; import { Widget } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account-container'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; -import { selectAccount } from 'soapbox/selectors'; -import { compareId } from 'soapbox/utils/comparators'; const messages = defineMessages({ title: { id: 'admin.latest_accounts_panel.title', defaultMessage: 'Latest Accounts' }, @@ -23,9 +21,7 @@ const LatestAccountsPanel: React.FC = ({ limit = 5 }) => { const intl = useIntl(); const history = useHistory(); const dispatch = useAppDispatch(); - const accountIds = useAppSelector>((state) => state.admin.get('latestUsers').take(limit)); - const hasDates = useAppSelector((state) => accountIds.every(id => !!selectAccount(state, id)?.created_at)); const [total, setTotal] = useState(accountIds.size); @@ -37,13 +33,6 @@ const LatestAccountsPanel: React.FC = ({ limit = 5 }) => { .catch(() => {}); }, []); - const sortedIds = accountIds.sort(compareId).reverse(); - const isSorted = hasDates && is(accountIds, sortedIds); - - if (!isSorted || !accountIds || accountIds.isEmpty()) { - return null; - } - const handleAction = () => { history.push('/soapbox/admin/users'); };