diff options
author | unarist <m.unarist@gmail.com> | 2018-03-31 20:16:38 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-03-31 13:16:38 +0200 |
commit | fb3dc00ddab3f8c1af42ebc0520f6108cc40a1fc (patch) | |
tree | f3f0ecfbeb08c26205aca1fb13d91299ff09ad52 | |
parent | e573bb0990ece4b1a521ccf8a4c7bec5972d3538 (diff) |
Ignore AbortError when cancelled sharing (#6978)
`navigator.share()` rejects Promise if user cancelled sharing, and it may print it as an error on JavaScript console. This patch ignores it and prints other errors on the console.
-rw-r--r-- | app/javascript/mastodon/components/status_action_bar.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/status_action_bar.js b/app/javascript/mastodon/components/status_action_bar.js index cd59c7845..e036dc1da 100644 --- a/app/javascript/mastodon/components/status_action_bar.js +++ b/app/javascript/mastodon/components/status_action_bar.js @@ -67,6 +67,8 @@ export default class StatusActionBar extends ImmutablePureComponent { navigator.share({ text: this.props.status.get('search_index'), url: this.props.status.get('url'), + }).catch((e) => { + if (e.name !== 'AbortError') console.error(e); }); } |