From 0d2b7f026fed4473974ae1546bb082eb12f72f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 18 May 2024 12:14:41 +0200 Subject: [PATCH] Feature-gate language picker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/features/compose/components/compose-form.tsx | 6 +++--- src/utils/features.ts | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/features/compose/components/compose-form.tsx b/src/features/compose/components/compose-form.tsx index d4c98b7cc..8d1857887 100644 --- a/src/features/compose/components/compose-form.tsx +++ b/src/features/compose/components/compose-form.tsx @@ -240,9 +240,9 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab const selectButtons = []; - if (features.privacyScopes && !group && !groupId) selectButtons.push(); - if (features.richText) selectButtons.push(); - selectButtons.push(); + if (features.privacyScopes && !group && !groupId) selectButtons.push(); + if (features.richText) selectButtons.push(); + if (features.postLanguages) selectButtons.push(); return ( diff --git a/src/utils/features.ts b/src/utils/features.ts index 439a5c39c..0ef55ea28 100644 --- a/src/utils/features.ts +++ b/src/utils/features.ts @@ -673,6 +673,15 @@ const getInstanceFeatures = (instance: Instance) => { v.software === TAKAHE && gte(v.version, '0.8.0'), ]), + /** + * Can select a language for statuses. + * @see POST /api/v1/statuses + */ + postLanguages: any([ + v.software === MASTODON, + v.software === PLEROMA && v.build === REBASED, + ]), + /** * Can set privacy scopes on statuses. * @see POST /api/v1/statuses