Explorar o código

fix: include deleted elements when passing to restore (#3802)

David Luzar %!s(int64=3) %!d(string=hai) anos
pai
achega
55d3287abf
Modificáronse 1 ficheiros con 7 adicións e 3 borrados
  1. 7 3
      src/components/App.tsx

+ 7 - 3
src/components/App.tsx

@@ -655,7 +655,11 @@ class App extends React.Component<AppProps, AppState> {
           const fileHandle = launchParams.files[0];
           const blob: Blob = await fileHandle.getFile();
           blob.handle = fileHandle;
-          loadFromBlob(blob, this.state, this.scene.getElements())
+          loadFromBlob(
+            blob,
+            this.state,
+            this.scene.getElementsIncludingDeleted(),
+          )
             .then(({ elements, appState }) =>
               this.syncActionResult({
                 elements,
@@ -3814,7 +3818,7 @@ class App extends React.Component<AppProps, AppState> {
         const { elements, appState } = await loadFromBlob(
           file,
           this.state,
-          this.scene.getElements(),
+          this.scene.getElementsIncludingDeleted(),
         );
         this.syncActionResult({
           elements,
@@ -3875,7 +3879,7 @@ class App extends React.Component<AppProps, AppState> {
   };
 
   loadFileToCanvas = (file: Blob) => {
-    loadFromBlob(file, this.state, this.scene.getElements())
+    loadFromBlob(file, this.state, this.scene.getElementsIncludingDeleted())
       .then(({ elements, appState }) =>
         this.syncActionResult({
           elements,