feat: Undo Accept (#7980)

* allow breaking of follow

* send undo

* delete by using reject follow
This commit is contained in:
nullobsi
2021-12-02 18:14:44 -08:00
committed by GitHub
parent a82ff360c6
commit f33ded3107
6 changed files with 136 additions and 1 deletions

View File

@ -109,6 +109,14 @@ export function getUserMenu(user) {
return !confirm.canceled;
}
async function invalidateFollow() {
os.apiWithDialog('following/invalidate', {
userId: user.id
}).then(() => {
user.isFollowed = !user.isFollowed;
})
}
let menu = [{
icon: 'fas fa-at',
text: i18n.locale.copyUsername,
@ -153,6 +161,14 @@ export function getUserMenu(user) {
action: toggleBlock
}]);
if (user.isFollowed) {
menu = menu.concat([{
icon: 'fas fa-unlink',
text: i18n.locale.breakFollow,
action: invalidateFollow
}]);
}
menu = menu.concat([null, {
icon: 'fas fa-exclamation-circle',
text: i18n.locale.reportAbuse,