From fe421257e5e9e3225393f544da0437596aa9a61b Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 27 Nov 2022 20:42:17 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=9CShare=20@{name}'s=20profile?= =?UTF-8?q?=E2=80=9D=20profile=20menu=20item=20(#21490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mastodon/features/account/components/header.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js index 1825e0de63..5eb89c0ea0 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;