diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index bc72890d..0128be01 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -1029,6 +1029,70 @@ function RelatedActions({ {privateNote ? 'Edit private note' : 'Add private note'} + {following && !!relationship && ( + <> + { + setRelationshipUIState('loading'); + (async () => { + try { + const rel = await currentMasto.v1.accounts + .$select(accountID.current) + .follow({ + notify: !notifying, + }); + if (rel) setRelationship(rel); + setRelationshipUIState('default'); + showToast( + rel.notifying + ? `Notifications enabled for @${username}'s posts.` + : ` Notifications disabled for @${username}'s posts.`, + ); + } catch (e) { + alert(e); + setRelationshipUIState('error'); + } + })(); + }} + > + + + {notifying + ? 'Disable notifications' + : 'Enable notifications'} + + + { + setRelationshipUIState('loading'); + (async () => { + try { + const rel = await currentMasto.v1.accounts + .$select(accountID.current) + .follow({ + reblogs: !showingReblogs, + }); + if (rel) setRelationship(rel); + setRelationshipUIState('default'); + showToast( + rel.showingReblogs + ? `Boosts from @${username} disabled.` + : `Boosts from @${username} enabled.`, + ); + } catch (e) { + alert(e); + setRelationshipUIState('error'); + } + })(); + }} + > + + + {showingReblogs ? 'Disable boosts' : 'Enable boosts'} + + + + )} {/* Add/remove from lists is only possible if following the account */} {following && (