diff --git a/.changeset/stupid-clocks-sleep.md b/.changeset/stupid-clocks-sleep.md new file mode 100644 index 00000000000..37a03a37ffd --- /dev/null +++ b/.changeset/stupid-clocks-sleep.md @@ -0,0 +1,5 @@ +--- +"@google-labs/visual-editor": patch +--- + +Null out the editor property sooner diff --git a/packages/visual-editor/src/index.ts b/packages/visual-editor/src/index.ts index f56d97ffe91..9be7abc213e 100644 --- a/packages/visual-editor/src/index.ts +++ b/packages/visual-editor/src/index.ts @@ -849,10 +849,11 @@ export class Main extends LitElement { this.graph = null; this.subGraphId = null; + // TODO: Figure out how to avoid needing to null this out. + this.#editor = null; + if (startEvent.descriptor) { this.graph = startEvent.descriptor; - // TODO: Figure out how to avoid needing to null this out. - this.#editor = null; } this.status = BreadboardUI.Types.STATUS.STOPPED; this.#runObserver = null; @@ -896,13 +897,9 @@ export class Main extends LitElement { this.graph = graph; this.#setPageTitle(); await this.#trackRecentBoard(); - // TODO: Figure out how to avoid needing to null this out. - this.#editor = null; } catch (err) { this.url = null; this.graph = null; - // TODO: Figure out how to avoid needing to null this out. - this.#editor = null; this.#failedGraphLoad = true; }