Catch `navigator.share` errors with a no-op
This commit is contained in:
parent
bc45bda517
commit
7156dc5c9b
|
@ -1,4 +1,5 @@
|
||||||
import { Controller } from '@hotwired/stimulus';
|
import { Controller } from '@hotwired/stimulus';
|
||||||
|
import noop from 'utilities/noop';
|
||||||
|
|
||||||
export default class extends Controller {
|
export default class extends Controller {
|
||||||
static values = {
|
static values = {
|
||||||
|
@ -35,8 +36,10 @@ export default class extends Controller {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
navigator.share(shareConfiguration).then(() => {
|
navigator.share(shareConfiguration)
|
||||||
|
.then(() => {
|
||||||
this.element.dispatchEvent(new CustomEvent('retrospring:shared'));
|
this.element.dispatchEvent(new CustomEvent('retrospring:shared'));
|
||||||
});
|
})
|
||||||
|
.catch(noop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue