Prechádzať zdrojové kódy

fix: Include `src/data/restore.ts`.

Daniel J. Geiger 2 rokov pred
rodič
commit
48c1f93e3e
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      src/data/restore.ts

+ 5 - 1
src/data/restore.ts

@@ -92,7 +92,8 @@ const repairBinding = (binding: PointBinding | null) => {
 };
 
 const restoreElementWithProperties = <
-  T extends Required<Omit<ExcalidrawElement, "customData">> & {
+  T extends Required<Omit<ExcalidrawElement, "subtype" | "customData">> & {
+    subtype?: ExcalidrawElement["subtype"];
     customData?: ExcalidrawElement["customData"];
     /** @deprecated */
     boundElementIds?: readonly ExcalidrawElement["id"][];
@@ -158,6 +159,9 @@ const restoreElementWithProperties = <
     locked: element.locked ?? false,
   };
 
+  if ("subtype" in element) {
+    base.subtype = element.subtype;
+  }
   if ("customData" in element) {
     base.customData = element.customData;
   }