about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/account/components/header.js
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-11-28 14:17:00 +0100
committerGitHub <noreply@github.com>2022-11-28 14:17:00 +0100
commit1a7aa37b60769a10077c585fa76ec848b6866d9a (patch)
tree9ea5aa74454bee29bf7be75c516e269fae296440 /app/javascript/flavours/glitch/features/account/components/header.js
parent6517b7b9f02f8590a8f9c5aa04e3ef9efeb4e757 (diff)
parentf51990bd62f434f377b5bbcbaa0ea205a87af403 (diff)
Merge pull request #1976 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours/glitch/features/account/components/header.js')
-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;