about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/account
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-11-27 20:42:17 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-11-28 11:54:00 +0100
commitc0bf90ac19fd4e8d6b11b8e4f3d48174f15ca57e (patch)
tree5520cb5858db0b5fab22ede134963aebe023a122 /app/javascript/flavours/glitch/features/account
parent32b43a96a774c169dd3023570656a5f89d10bb6d (diff)
[Glitch] Fix “Share @{name}'s profile” profile menu item
Port fe421257e5e9e3225393f544da0437596aa9a61b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/account')
-rw-r--r--app/javascript/flavours/glitch/features/account/components/header.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js
index 47c074ec3..9a5f2fd62 100644
--- a/app/javascript/flavours/glitch/features/account/components/header.js
+++ b/app/javascript/flavours/glitch/features/account/components/header.js
@@ -141,6 +141,17 @@ class Header extends ImmutablePureComponent {
     }
   }
 
+  handleShare = () => {
+    const { account } = this.props;
+
+    navigator.share({
+      text: `${titleFromAccount(account)}\n${account.get('note_plain')}`,
+      url: account.get('url'),
+    }).catch((e) => {
+      if (e.name !== 'AbortError') console.error(e);
+    });
+  }
+
   render () {
     const { account, hidden, intl, domain } = this.props;
     const { signedIn } = this.context.identity;