Do not display account suggestion dismiss button if not supported

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-09-12 23:03:09 +02:00
parent c96a7c4dde
commit 0a7bdbb7d0
11 changed files with 24 additions and 72 deletions

View File

@@ -861,7 +861,7 @@ class PlApiClient {
* Remove a suggestion
* Remove an account from follow suggestions.
*
* Requires features{@link Features['suggestions']}.
* Requires features{@link Features['suggestionsDismiss']}.
* @see {@link https://docs.joinmastodon.org/methods/suggestions/#remove}
*/
dismissSuggestions: async (accountId: string) => {

View File

@@ -1085,6 +1085,14 @@ const getFeatures = (instance?: Instance) => {
features.includes('v2_suggestions'),
]),
/**
* Remove an account from follow suggestions
* @see DELETE /api/v1/suggestions/:account_id
*/
suggestionsDismiss: any([
v.software === MASTODON,
]),
/**
* Supports V2 suggested accounts.
* @see GET /api/v2/suggestions

View File

@@ -1,6 +1,6 @@
{
"name": "pl-api",
"version": "0.0.28",
"version": "0.0.29",
"type": "module",
"homepage": "https://github.com/mkljczk/pl-fe/tree/fork/packages/pl-api",
"repository": {