diff --git a/src/utils/saveload.ts b/src/utils/saveload.ts index ad9a4f3..43a6ec0 100644 --- a/src/utils/saveload.ts +++ b/src/utils/saveload.ts @@ -2,6 +2,7 @@ import { IEditorState } from '../Interfaces/IEditorState'; import { IHistoryState } from '../Interfaces/IHistoryState'; import { IContainerModel } from '../Interfaces/IContainerModel'; +import { ISymbolModel } from '../Interfaces/ISymbolModel'; /** * Revive the Editor state @@ -29,13 +30,14 @@ export function ReviveState(state: IHistoryState): void { return; } - state.symbols = new Map(state.symbols); + const symbols: Array<{ Key: string, Value: ISymbolModel }> = (state.symbols) as any; + state.symbols = new Map(symbols.map(({ Key, Value }) => [Key, Value])); for (const symbol of state.symbols.values()) { symbol.linkedContainers = new Set(symbol.linkedContainers); } const containers: Array<{ Key: string, Value: IContainerModel }> = (state.containers) as any; - state.containers = new Map(containers.map(({ Key, Value }: {Key: string, Value: IContainerModel}) => [Key, Value])); + state.containers = new Map(containers.map(({ Key, Value }) => [Key, Value])); } export function GetCircularReplacer(): (key: any, value: object | Map | null) => object | null | undefined {