Skip to content

Commit

Permalink
fix: reset all views when fromjson (#3346)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Mar 6, 2023
1 parent 42011b7 commit 1de8ebe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/x6/src/renderer/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

1 comment on commit 1de8ebe

@jianjianghui
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

应该保持原有的代码逻辑,同步修改 this.willRemoveViews的引用地址
#3351

Please sign in to comment.