From 7413e83dcc016e3ab4bd60b1cb483282e89c7d68 Mon Sep 17 00:00:00 2001 From: Marten Lohstroh Date: Wed, 19 Jul 2023 17:17:34 -0700 Subject: [PATCH] Bugfix (and made _key readonly) --- src/core/component.ts | 2 +- src/core/reactor.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/component.ts b/src/core/component.ts index 55e16f59a..1a779be39 100644 --- a/src/core/component.ts +++ b/src/core/component.ts @@ -18,7 +18,7 @@ export abstract class Component { * A symbol that identifies this component, and it also used to selectively * grant access to its privileged functions. */ - protected _key = Symbol(uuidv4()); + protected readonly _key = Symbol(uuidv4()); /** * The container of this component. Each component is contained by a diff --git a/src/core/reactor.ts b/src/core/reactor.ts index 2b9e0e450..c36e624ba 100644 --- a/src/core/reactor.ts +++ b/src/core/reactor.ts @@ -393,10 +393,7 @@ export abstract class Reactor extends Component { } } else if (allowCreatorKey ?? false) { console.log("trying to get key......") - if (this._creatorKeyChain.get(component) != null) { - return this._creatorKeyChain.get(component); - } - return this._creatorKeyChain.get(component.getContainer()); + return component.getContainer()._getKey(component, this._creatorKeyChain.get(component.getContainer())); } }