refactor(web): dependency management (#2386)
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import { WebApplication } from '@/Application/WebApplication'
|
||||
import { getBase64FromBlob } from '@/Utils'
|
||||
import { MobileDeviceInterface } from '@standardnotes/snjs'
|
||||
|
||||
export const shareBlobOnMobile = async (application: WebApplication, blob: Blob, filename: string) => {
|
||||
if (!application.isNativeMobileWeb()) {
|
||||
export const shareBlobOnMobile = async (
|
||||
mobileDevice: MobileDeviceInterface,
|
||||
isNativeMobileWeb: boolean,
|
||||
blob: Blob,
|
||||
filename: string,
|
||||
) => {
|
||||
if (!isNativeMobileWeb) {
|
||||
throw new Error('Share function being used outside mobile webview')
|
||||
}
|
||||
const base64 = await getBase64FromBlob(blob)
|
||||
void application.mobileDevice().shareBase64AsFile(base64, filename)
|
||||
void mobileDevice.shareBase64AsFile(base64, filename)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user