Merge remote-tracking branch 'origin/master' into aakansha-custom-elements

Update customType
This commit is contained in:
ad1992
2022-03-25 22:32:28 +05:30
25 changed files with 381 additions and 229 deletions
+5 -5
View File
@@ -30,8 +30,8 @@ type RestoredAppState = Omit<
"offsetTop" | "offsetLeft" | "width" | "height"
>;
export const AllowedExcalidrawElementTypes: Record<
AppState["elementType"],
export const AllowedExcalidrawActiveTools: Record<
AppState["activeTool"]["type"],
boolean
> = {
selection: true,
@@ -258,9 +258,9 @@ export const restoreAppState = (
return {
...nextAppState,
elementType: AllowedExcalidrawElementTypes[nextAppState.elementType]
? nextAppState.elementType
: "selection",
activeTool: AllowedExcalidrawActiveTools[nextAppState.activeTool.type]
? nextAppState.activeTool
: { type: "selection" },
// Migrates from previous version where appState.zoom was a number
zoom:
typeof appState.zoom === "number"