feat: add logging for component logic and event attachment in DynamicComponent

pull/10/head
David Montero Crespo 2026-03-04 13:44:55 -03:00
parent ef7e86bc1e
commit 1269550e8a
1 changed files with 3 additions and 0 deletions

View File

@ -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
console.log(`[DynamicComponent] Component ${id} (${metadata.id}): Logic found =`, !!logic);
let cleanupSimulationEvents: (() => void) | undefined;
if (logic && logic.attachEvents) {
console.log(`[DynamicComponent] Attaching events for ${id} (${metadata.id})`);
// We need AVRSimulator instance. We can grab it from store.
const simulator = useSimulatorStore.getState().simulator;
if (simulator) {