From 01f5914a8283fe51ce65885b3c1f078b178e3d36 Mon Sep 17 00:00:00 2001 From: kbariotis Date: Mon, 22 Mar 2021 21:59:10 +0200 Subject: [PATCH] auto save only when its supported --- src/actions/actionExport.tsx | 37 +++++++++++++++++++----------------- src/components/App.tsx | 2 +- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/actions/actionExport.tsx b/src/actions/actionExport.tsx index a85908583..e430b4131 100644 --- a/src/actions/actionExport.tsx +++ b/src/actions/actionExport.tsx @@ -248,21 +248,24 @@ export const actionToggleAutoSave = register({ commitToHistory: false, }; }, - PanelComponent: ({ appState, updateData }) => ( - - ), + PanelComponent: ({ appState, updateData }) => + supported ? ( + + ) : ( + <> + ), }); diff --git a/src/components/App.tsx b/src/components/App.tsx index 87e0a2e02..92d80ecf4 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -910,7 +910,7 @@ class App extends React.Component { .querySelector(".excalidraw") ?.classList.toggle("theme--dark", this.state.theme === "dark"); - if (this.state.autoSave && this.state.fileHandle) { + if (this.state.autoSave && this.state.fileHandle && supported) { try { this.saveLocalSceneDebounced( this.scene.getElementsIncludingDeleted(),