summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts
diff options
context:
space:
mode:
authornullobsi <me@nullob.si>2021-12-02 18:14:44 -0800
committerGitHub <noreply@github.com>2021-12-03 11:14:44 +0900
commitf33ded310751dd1b4bfd6fb792eec9adfde7019e (patch)
tree737d44379317d8ab0362cc438fbc8ad5b9c6dc9d /packages/client/src/scripts
parentadd todo (diff)
downloadsharkey-f33ded310751dd1b4bfd6fb792eec9adfde7019e.tar.gz
sharkey-f33ded310751dd1b4bfd6fb792eec9adfde7019e.tar.bz2
sharkey-f33ded310751dd1b4bfd6fb792eec9adfde7019e.zip
feat: Undo Accept (#7980)
* allow breaking of follow * send undo * delete by using reject follow
Diffstat (limited to 'packages/client/src/scripts')
-rw-r--r--packages/client/src/scripts/get-user-menu.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/client/src/scripts/get-user-menu.ts b/packages/client/src/scripts/get-user-menu.ts
index 0c04547101..ebe101bc0f 100644
--- a/packages/client/src/scripts/get-user-menu.ts
+++ b/packages/client/src/scripts/get-user-menu.ts
@@ -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,