2019-02-15 06:26:28 +01:00
|
|
|
import { toast } from '../_components/toast/toast'
|
|
|
|
import { statusHtmlToPlainText } from '../_utils/statusHtmlToPlainText'
|
|
|
|
|
|
|
|
export async function shareStatus (status) {
|
|
|
|
try {
|
|
|
|
await navigator.share({
|
|
|
|
title: status.spoiler_text || undefined,
|
|
|
|
text: statusHtmlToPlainText(status.content, status.mentions),
|
|
|
|
url: status.url
|
|
|
|
})
|
|
|
|
} catch (e) {
|
2019-08-20 04:08:59 +02:00
|
|
|
toast.say('Unable to share: ' + (e.message || ''))
|
2019-02-15 06:26:28 +01:00
|
|
|
}
|
|
|
|
}
|