From 1c11df011a2f1eaf7f1164f475c94fc3ebe9f36b Mon Sep 17 00:00:00 2001 From: David Luzar Date: Fri, 19 Nov 2021 14:20:42 +0100 Subject: [PATCH] fix: new FS API not working on Linux (#4280) --- src/data/filesystem.ts | 4 ++-- src/data/index.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/filesystem.ts b/src/data/filesystem.ts index 1c7f137c..55f41171 100644 --- a/src/data/filesystem.ts +++ b/src/data/filesystem.ts @@ -22,7 +22,7 @@ const INPUT_CHANGE_INTERVAL_MS = 500; export const fileOpen = (opts: { extensions?: FILE_EXTENSION[]; - description?: string; + description: string; multiple?: M; }): Promise< M extends false | undefined ? FileWithHandle : FileWithHandle[] @@ -94,7 +94,7 @@ export const fileSave = ( name: string; /** file extension */ extension: FILE_EXTENSION; - description?: string; + description: string; /** existing FileSystemHandle */ fileHandle?: FileSystemHandle | null; }, diff --git a/src/data/index.ts b/src/data/index.ts index fbc4664f..88966461 100644 --- a/src/data/index.ts +++ b/src/data/index.ts @@ -54,6 +54,7 @@ export const exportCanvas = async ( return await fileSave( new Blob([tempSvg.outerHTML], { type: MIME_TYPES.svg }), { + description: "Export to SVG", name, extension: "svg", fileHandle, @@ -86,6 +87,7 @@ export const exportCanvas = async ( } return await fileSave(blob, { + description: "Export to PNG", name, extension: "png", fileHandle,