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

This commit is contained in:
ad1992
2022-03-29 17:26:46 +05:30
14 changed files with 209 additions and 116 deletions
+1 -4
View File
@@ -238,10 +238,8 @@ export const restoreAppState = (
localAppState: Partial<AppState> | null | undefined,
): RestoredAppState => {
appState = appState || {};
const defaultAppState = getDefaultAppState();
const nextAppState = {} as typeof defaultAppState;
for (const [key, defaultValue] of Object.entries(defaultAppState) as [
keyof typeof defaultAppState,
any,
@@ -255,12 +253,11 @@ export const restoreAppState = (
? localValue
: defaultValue;
}
return {
...nextAppState,
activeTool: AllowedExcalidrawActiveTools[nextAppState.activeTool.type]
? nextAppState.activeTool
: { type: "selection" },
: { ...nextAppState.activeTool, type: "selection" },
// Migrates from previous version where appState.zoom was a number
zoom:
typeof appState.zoom === "number"