Add Native File System API saving/exporting and opening (#388)

* Add Native File System API saving/exporting

* Add Native File System API opening

* Add origin trial token placeholder

* Reuse an opened file handle for better saving experience

* Fix file handle reuse to only kick in for Excalidraw files

* Remove reference
This commit is contained in:
Thomas Steiner 2020-01-17 11:25:05 +01:00 committed by GitHub
parent f4d4b323e1
commit 7ddc206b8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 143 additions and 39 deletions

View file

@ -39,6 +39,10 @@ export const actionClearCanvas: Action = {
aria-label="Clear the canvas & reset background color"
onClick={() => {
if (window.confirm("This will clear the whole canvas. Are you sure?")) {
// TODO: Defined globally, since file handles aren't yet serializable.
// Once `FileSystemFileHandle` can be serialized, make this
// part of `AppState`.
(window as any).handle = null;
updateData(null);
}
}}