From 1de8ebe77abe9820229c3e99f8b75ee6f6058112 Mon Sep 17 00:00:00 2001 From: vector Date: Mon, 6 Mar 2023 11:35:25 +0800 Subject: [PATCH] fix: reset all views when fromjson (#3346) --- packages/x6/src/renderer/scheduler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/x6/src/renderer/scheduler.ts b/packages/x6/src/renderer/scheduler.ts index 7ac065c4cab..a8765e95c17 100644 --- a/packages/x6/src/renderer/scheduler.ts +++ b/packages/x6/src/renderer/scheduler.ts @@ -318,9 +318,9 @@ export class Scheduler extends Disposable { } protected resetViews() { - this.willRemoveViews = { ...this.views } - Object.keys(this.willRemoveViews).forEach((id) => { - const viewItem = this.willRemoveViews[id] + const willRemoveViews = { ...this.views, ...this.willRemoveViews } + Object.keys(willRemoveViews).forEach((id) => { + const viewItem = willRemoveViews[id] if (viewItem) { this.removeView(viewItem.view) }