2021-08-10 06:50:17 -07:00
|
|
|
import noop from 'retrospring/utilities/noop';
|
|
|
|
|
2021-08-10 04:16:40 -07:00
|
|
|
export function createShareEvent(answerbox: HTMLElement): () => void {
|
|
|
|
return function (): void {
|
|
|
|
navigator.share({
|
2021-08-10 09:07:33 -07:00
|
|
|
url: answerbox.querySelector<HTMLAnchorElement>('.answerbox__answer-date > a, a.answerbox__permalink').href
|
2021-08-10 04:16:40 -07:00
|
|
|
})
|
2021-08-10 06:50:17 -07:00
|
|
|
.then(noop)
|
|
|
|
.catch(noop)
|
2021-08-10 04:16:40 -07:00
|
|
|
}
|
|
|
|
}
|