mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
parent
68bdfaefbe
commit
b2822f3538
7 changed files with 33 additions and 18 deletions
|
@ -29,6 +29,7 @@ const loadFileContents = async (blob: any) => {
|
|||
*/
|
||||
export const loadFromBlob = async (blob: any, appState?: AppState) => {
|
||||
if (blob.handle) {
|
||||
// TODO: Make this part of `AppState`.
|
||||
(window as any).handle = blob.handle;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,9 +66,7 @@ export type SocketUpdateDataIncoming =
|
|||
type: "INVALID_RESPONSE";
|
||||
};
|
||||
|
||||
// TODO: Defined globally, since file handles aren't yet serializable.
|
||||
// Once `FileSystemFileHandle` can be serialized, make this
|
||||
// part of `AppState`.
|
||||
// TODO: Make this part of `AppState`.
|
||||
(window as any).handle = null;
|
||||
|
||||
const byteToHex = (byte: number): string => `0${byte.toString(16)}`.slice(-2);
|
||||
|
|
|
@ -33,6 +33,7 @@ export const saveAsJSON = async (
|
|||
type: "application/json",
|
||||
});
|
||||
const name = `${appState.name}.excalidraw`;
|
||||
// TODO: Make this part of `AppState`.
|
||||
(window as any).handle = await fileSave(
|
||||
blob,
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue