From c0bf90ac19fd4e8d6b11b8e4f3d48174f15ca57e Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 27 Nov 2022 20:42:17 +0100 Subject: [PATCH] =?UTF-8?q?[Glitch]=20Fix=20=E2=80=9CShare=20@{name}'s=20p?= =?UTF-8?q?rofile=E2=80=9D=20profile=20menu=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port fe421257e5e9e3225393f544da0437596aa9a61b to glitch-soc Signed-off-by: Claire --- .../glitch/features/account/components/header.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js index 47c074ec3d..9a5f2fd62d 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;