fix: new FS API not working on Linux (#4280)
This commit is contained in:
parent
59e9651547
commit
1c11df011a
@ -22,7 +22,7 @@ const INPUT_CHANGE_INTERVAL_MS = 500;
|
|||||||
|
|
||||||
export const fileOpen = <M extends boolean | undefined = false>(opts: {
|
export const fileOpen = <M extends boolean | undefined = false>(opts: {
|
||||||
extensions?: FILE_EXTENSION[];
|
extensions?: FILE_EXTENSION[];
|
||||||
description?: string;
|
description: string;
|
||||||
multiple?: M;
|
multiple?: M;
|
||||||
}): Promise<
|
}): Promise<
|
||||||
M extends false | undefined ? FileWithHandle : FileWithHandle[]
|
M extends false | undefined ? FileWithHandle : FileWithHandle[]
|
||||||
@ -94,7 +94,7 @@ export const fileSave = (
|
|||||||
name: string;
|
name: string;
|
||||||
/** file extension */
|
/** file extension */
|
||||||
extension: FILE_EXTENSION;
|
extension: FILE_EXTENSION;
|
||||||
description?: string;
|
description: string;
|
||||||
/** existing FileSystemHandle */
|
/** existing FileSystemHandle */
|
||||||
fileHandle?: FileSystemHandle | null;
|
fileHandle?: FileSystemHandle | null;
|
||||||
},
|
},
|
||||||
|
@ -54,6 +54,7 @@ export const exportCanvas = async (
|
|||||||
return await fileSave(
|
return await fileSave(
|
||||||
new Blob([tempSvg.outerHTML], { type: MIME_TYPES.svg }),
|
new Blob([tempSvg.outerHTML], { type: MIME_TYPES.svg }),
|
||||||
{
|
{
|
||||||
|
description: "Export to SVG",
|
||||||
name,
|
name,
|
||||||
extension: "svg",
|
extension: "svg",
|
||||||
fileHandle,
|
fileHandle,
|
||||||
@ -86,6 +87,7 @@ export const exportCanvas = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
return await fileSave(blob, {
|
return await fileSave(blob, {
|
||||||
|
description: "Export to PNG",
|
||||||
name,
|
name,
|
||||||
extension: "png",
|
extension: "png",
|
||||||
fileHandle,
|
fileHandle,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user