From fe421257e5e9e3225393f544da0437596aa9a61b Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 27 Nov 2022 20:42:17 +0100 Subject: Fix “Share @{name}'s profile” profile menu item (#21490) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/javascript/mastodon/features/account/components/header.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js index 1825e0de6..5eb89c0ea 100644 --- a/app/javascript/mastodon/features/account/components/header.js +++ b/app/javascript/mastodon/features/account/components/header.js @@ -149,6 +149,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; -- cgit