feat: Mute and unfollow when blocking a user

This commit is contained in:
Daniel Hernández 2023-02-09 13:17:14 -04:00
parent f2dc07522b
commit 135860cc68
No known key found for this signature in database
GPG Key ID: 1FE6E4A6C61D7B31
1 changed files with 11 additions and 2 deletions

View File

@ -125,11 +125,20 @@ export function getUserMenu(user, router: Router = mainRouter) {
)
return;
os.apiWithDialog(user.isBlocking ? "blocking/delete" : "blocking/create", {
await os.apiWithDialog(user.isBlocking ? "blocking/delete" : "blocking/create", {
userId: user.id,
}).then(() => {
})
user.isBlocking = !user.isBlocking;
await os.api(user.isBlocking ? "mute/create" : "mute/delete", {
userId: user.id,
})
user.isMuted = user.isBlocking;
if (user.isBlocking) {
await os.api('following/delete', {
userId: user.id,
});
user.isFollowing = false
}
}
async function toggleSilence() {