feat: add logging for component logic and event attachment in DynamicComponent
This commit is contained in:
parent
ef7e86bc1e
commit
1269550e8a
|
|
@ -179,8 +179,11 @@ export const DynamicComponent: React.FC<DynamicComponentProps> = ({
|
||||||
|
|
||||||
const logic = PartSimulationRegistry.get(metadata.id || id.split('-')[0]); // Fallback if id is like led-1
|
const logic = PartSimulationRegistry.get(metadata.id || id.split('-')[0]); // Fallback if id is like led-1
|
||||||
|
|
||||||
|
console.log(`[DynamicComponent] Component ${id} (${metadata.id}): Logic found =`, !!logic);
|
||||||
|
|
||||||
let cleanupSimulationEvents: (() => void) | undefined;
|
let cleanupSimulationEvents: (() => void) | undefined;
|
||||||
if (logic && logic.attachEvents) {
|
if (logic && logic.attachEvents) {
|
||||||
|
console.log(`[DynamicComponent] Attaching events for ${id} (${metadata.id})`);
|
||||||
// We need AVRSimulator instance. We can grab it from store.
|
// We need AVRSimulator instance. We can grab it from store.
|
||||||
const simulator = useSimulatorStore.getState().simulator;
|
const simulator = useSimulatorStore.getState().simulator;
|
||||||
if (simulator) {
|
if (simulator) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue