Update to browser-nativefs v0.1.0 (#523)

This commit is contained in:
Thomas Steiner 2020-01-23 17:15:44 +01:00 committed by Lipis
parent 926b4f24e6
commit d24b9c4d78
3 changed files with 5 additions and 13 deletions

View file

@ -6,7 +6,7 @@ import { AppState } from "../types";
import { ExportType } from "./types";
import { getExportCanvasPreview } from "./getExportCanvasPreview";
import nanoid from "nanoid";
import { fileOpenPromise, fileSavePromise } from "browser-nativefs";
import { fileOpen, fileSave } from "browser-nativefs";
import i18n from "../i18n";
@ -15,14 +15,6 @@ const LOCAL_STORAGE_KEY_STATE = "excalidraw-state";
const BACKEND_POST = "https://json.excalidraw.com/api/v1/post/";
const BACKEND_GET = "https://json.excalidraw.com/api/v1/";
let fileOpen: Function;
let fileSave: Function;
(async () => {
fileOpen = (await fileOpenPromise).default;
fileSave = (await fileSavePromise).default;
})();
// TODO: Defined globally, since file handles aren't yet serializable.
// Once `FileSystemFileHandle` can be serialized, make this
// part of `AppState`.