From 0c954ada9386a73c0020b7cde495919b76d1ba9e 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 f47fbb8729990e05770054c44e184d0c27eb1055 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;