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:
@ -40,7 +40,7 @@ export const actionChangeExportBackground: Action = {
|
||||
export const actionSaveScene: Action = {
|
||||
name: "saveScene",
|
||||
perform: (elements, appState, value) => {
|
||||
saveAsJSON(elements, appState);
|
||||
saveAsJSON(elements, appState).catch(err => console.error(err));
|
||||
return {};
|
||||
},
|
||||
PanelComponent: ({ updateData }) => (
|
||||
@ -70,9 +70,11 @@ export const actionLoadScene: Action = {
|
||||
title="Load"
|
||||
aria-label="Load"
|
||||
onClick={() => {
|
||||
loadFromJSON().then(({ elements, appState }) => {
|
||||
updateData({ elements: elements, appState: appState });
|
||||
});
|
||||
loadFromJSON()
|
||||
.then(({ elements, appState }) => {
|
||||
updateData({ elements: elements, appState: appState });
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
Reference in New Issue
Block a user