Browse Source

fix: initial state

Arnošt Pleskot 2 years ago
parent
commit
5d9d2afcb7
2 changed files with 4 additions and 2 deletions
  1. 3 1
      src/appState.ts
  2. 1 1
      src/types.ts

+ 3 - 1
src/appState.ts

@@ -5,6 +5,7 @@ import {
   DEFAULT_FONT_FAMILY,
   DEFAULT_FONT_FAMILY,
   DEFAULT_FONT_SIZE,
   DEFAULT_FONT_SIZE,
   DEFAULT_TEXT_ALIGN,
   DEFAULT_TEXT_ALIGN,
+  EXPORT_BACKGROUND_IMAGES,
   EXPORT_SCALES,
   EXPORT_SCALES,
   THEME,
   THEME,
 } from "./constants";
 } from "./constants";
@@ -100,7 +101,8 @@ export const getDefaultAppState = (): Omit<
     pendingImageElementId: null,
     pendingImageElementId: null,
     showHyperlinkPopup: false,
     showHyperlinkPopup: false,
     selectedLinearElement: null,
     selectedLinearElement: null,
-    exportBackgroundImage: DEFAULT_EXPORT_BACKGROUND_IMAGE,
+    exportBackgroundImage:
+      EXPORT_BACKGROUND_IMAGES[DEFAULT_EXPORT_BACKGROUND_IMAGE].path,
   };
   };
 };
 };
 
 

+ 1 - 1
src/types.ts

@@ -287,7 +287,7 @@ export type AppState = {
   pendingImageElementId: ExcalidrawImageElement["id"] | null;
   pendingImageElementId: ExcalidrawImageElement["id"] | null;
   showHyperlinkPopup: false | "info" | "editor";
   showHyperlinkPopup: false | "info" | "editor";
   selectedLinearElement: LinearElementEditor | null;
   selectedLinearElement: LinearElementEditor | null;
-  exportBackgroundImage: string;
+  exportBackgroundImage: string | null;
 };
 };
 
 
 export type UIAppState = Omit<
 export type UIAppState = Omit<