From 33d6edda38e9d4329eca83024de4d1df1a80151f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 7 Sep 2024 03:14:50 +0200 Subject: [PATCH] Split `local-visibility-post` feature into `@pleroma` and `@akkoma` variants Co-authored-by: Lim Chee Aun --- src/components/compose.jsx | 2 +- src/utils/supports.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 76d2262e..3fa5ca6b 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -1169,7 +1169,7 @@ function Compose({ - {supports('@pleroma/local-visibility-post') && + {(supports('@pleroma/local-visibility-post') || supports('@akkoma/local-visibility-post')) && diff --git a/src/utils/supports.js b/src/utils/supports.js index cc396233..d570f8bd 100644 --- a/src/utils/supports.js +++ b/src/utils/supports.js @@ -7,7 +7,8 @@ import { getCurrentInstance } from './store-utils'; // Non-semver(?) UA string detection const containPixelfed = /pixelfed/i; const notContainPixelfed = /^(?!.*pixelfed).*$/i; -const containAnyOma = /(?:pler|akk)oma/i +const containPleroma = /pleroma/i; +const containAkkoma = /akkoma/i; const platformFeatures = { '@mastodon/lists': notContainPixelfed, '@mastodon/filters': notContainPixelfed, @@ -21,7 +22,8 @@ const platformFeatures = { '@pixelfed/trending': containPixelfed, '@pixelfed/home-include-reblogs': containPixelfed, '@pixelfed/global-feed': containPixelfed, - '@pleroma/local-visibility-post': containAnyOma, + '@pleroma/local-visibility-post': containPleroma, + '@akkoma/local-visibility-post': containAkkoma, }; const supportsCache = {};