mirror of
https://github.com/standardnotes/app
synced 2026-10-20 12:03:13 -04:00
11 lines
440 B
TypeScript
11 lines
440 B
TypeScript
import { WebApplication } from '@/Application/Application'
|
|
import { getBase64FromBlob } from '@/Utils'
|
|
|
|
export const shareBlobOnMobile = async (application: WebApplication, blob: Blob, filename: string) => {
|
|
if (!application.isNativeMobileWeb()) {
|
|
throw new Error('Share function being used outside mobile webview')
|
|
}
|
|
const base64 = await getBase64FromBlob(blob)
|
|
application.mobileDevice().shareBase64AsFile(base64, filename)
|
|
}
|