From 8f6d1da008f33a30c15ac3546679f6a4158dd159 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 28 Aug 2024 13:17:46 +0200 Subject: [PATCH] Add support for Pleroma instances --- src/components/compose.jsx | 2 +- src/utils/supports.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 64470675..7b1a0953 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -1178,7 +1178,7 @@ function Compose({ - {supports('@akkoma/local-only') && + {supports('@pleroma/local-only') && diff --git a/src/utils/supports.js b/src/utils/supports.js index 1560e718..c7719bcb 100644 --- a/src/utils/supports.js +++ b/src/utils/supports.js @@ -7,8 +7,8 @@ import { getCurrentInstance } from './store-utils'; // Non-semver(?) UA string detection const containPixelfed = /pixelfed/i; const notContainPixelfed = /^(?!.*pixelfed).*$/i; -const containAkkoma = /akkoma/i -const notContainAkkoma = /^(?! *akkoma) *$/i +const containAnyOma = /(?:pler|akk)oma/i +const notContainAnyOma = /^(?! *(?:pler|akk)oma) *$/i const platformFeatures = { '@mastodon/lists': notContainPixelfed, '@mastodon/filters': notContainPixelfed, @@ -22,13 +22,14 @@ const platformFeatures = { '@pixelfed/trending': containPixelfed, '@pixelfed/home-include-reblogs': containPixelfed, '@pixelfed/global-feed': containPixelfed, - '@akkoma/local-only': containAkkoma, + '@pleroma/local-only': containAnyOma, }; const supportsCache = {}; function supports(feature) { try { const { version, domain } = getCurrentInstance(); + console.debug(version) const key = `${domain}-${feature}`; if (supportsCache[key]) return supportsCache[key];