commit: fb3dc00ddab3f8c1af42ebc0520f6108cc40a1fc
parent e573bb0990ece4b1a521ccf8a4c7bec5972d3538
Author: unarist <m.unarist@gmail.com>
Date: Sat, 31 Mar 2018 20:16:38 +0900
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.
Diffstat:
1 file 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
@@ -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);
});
}