mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-02-12 01:34:42 +01:00
Unrecommend federations
This commit is contained in:
committed by
Paul Miller
parent
7480461ac2
commit
b00d634066
@@ -378,6 +378,20 @@ function RecommendButton(props: { fed: MutinyFederationIdentity }) {
|
||||
setRecommendLoading(false);
|
||||
}
|
||||
|
||||
async function deleteRecommendation() {
|
||||
setRecommendLoading(true);
|
||||
try {
|
||||
await state.mutiny_wallet?.delete_federation_recommendation(
|
||||
props.fed.federation_id
|
||||
);
|
||||
setRecommended(false);
|
||||
refetch();
|
||||
} catch (e) {
|
||||
console.error("Error deleting federation recommendation: ", e);
|
||||
}
|
||||
setRecommendLoading(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<Switch>
|
||||
<Match when={recommendedByMe() || recommended()}>
|
||||
@@ -385,6 +399,13 @@ function RecommendButton(props: { fed: MutinyFederationIdentity }) {
|
||||
<BadgeCheck />
|
||||
Recommended by you
|
||||
</p>
|
||||
<Button
|
||||
intent="red"
|
||||
onClick={deleteRecommendation}
|
||||
loading={recommendLoading()}
|
||||
>
|
||||
Unrecommend
|
||||
</Button>
|
||||
</Match>
|
||||
<Match when={true}>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user