Fix error on file save/save-as (#496)
* fix dynamic import * Remove console log * Fix other imports too
This commit is contained in:
parent
f61c09fb55
commit
36a6026cb3
1 changed files with 6 additions and 3 deletions
|
@ -48,7 +48,8 @@ export async function saveToFileSystem(document: TDDocument, fileHandle: FileSys
|
|||
|
||||
// Save to file system
|
||||
// @ts-ignore
|
||||
const fileSave = await import('./browser-fs-access').default.fileSave
|
||||
const browserFS = await import('./browser-fs-access')
|
||||
const fileSave = browserFS.fileSave
|
||||
const newFileHandle = await fileSave(
|
||||
blob,
|
||||
{
|
||||
|
@ -71,7 +72,8 @@ export async function openFromFileSystem(): Promise<null | {
|
|||
}> {
|
||||
// Get the blob
|
||||
// @ts-ignore
|
||||
const fileOpen = await import('./browser-fs-access').fileOpen
|
||||
const browserFS = await import('./browser-fs-access')
|
||||
const fileOpen = browserFS.fileOpen
|
||||
const blob = await fileOpen({
|
||||
description: 'Tldraw File',
|
||||
extensions: [`.tldr`],
|
||||
|
@ -106,7 +108,8 @@ export async function openFromFileSystem(): Promise<null | {
|
|||
|
||||
export async function openAssetFromFileSystem() {
|
||||
// @ts-ignore
|
||||
const fileOpen = await import('./browser-fs-access').fileOpen
|
||||
const browserFS = await import('./browser-fs-access')
|
||||
const fileOpen = browserFS.fileOpen
|
||||
return fileOpen({
|
||||
description: 'Image or Video',
|
||||
extensions: [...IMAGE_EXTENSIONS, ...VIDEO_EXTENSIONS],
|
||||
|
|
Loading…
Reference in a new issue