From 86e673404e87f373f91a38b460f91616ffdfa1e4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 24 May 2022 14:06:59 -0400 Subject: [PATCH] Fix feature gating of Pleroma data imports --- app/soapbox/features/import_data/index.tsx | 5 +---- app/soapbox/features/ui/index.tsx | 2 +- app/soapbox/utils/features.ts | 6 ++++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/soapbox/features/import_data/index.tsx b/app/soapbox/features/import_data/index.tsx index b03b20f29..5d26fa0ec 100644 --- a/app/soapbox/features/import_data/index.tsx +++ b/app/soapbox/features/import_data/index.tsx @@ -6,8 +6,6 @@ import { importBlocks, importMutes, } from 'soapbox/actions/import_data'; -import { useAppSelector } from 'soapbox/hooks'; -import { getFeatures } from 'soapbox/utils/features'; import Column from '../ui/components/column'; @@ -38,13 +36,12 @@ const muteMessages = defineMessages({ const ImportData = () => { const intl = useIntl(); - const features = getFeatures(useAppSelector((state) => state.instance)); return ( - {features.importMutes && } + ); }; diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index 0ebb8f87a..948e5a5e2 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -287,7 +287,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => { - + {features.importData && } {features.accountAliasesAPI && } {features.accountMoving && } diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index e020456d1..e98b7262c 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -307,10 +307,12 @@ const getInstanceFeatures = (instance: Instance) => { importAPI: v.software === PLEROMA, /** - * Pleroma import mutes API. + * Pleroma import endpoints. + * @see POST /api/pleroma/follow_import + * @see POST /api/pleroma/blocks_import * @see POST /api/pleroma/mutes_import */ - importMutes: v.software === PLEROMA && gte(v.version, '2.2.0'), + importData: v.software === PLEROMA && gte(v.version, '2.2.0'), /** * Can create, view, and manage lists.