File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,26 @@ export const schematicSimulationSvgHandler = async (
2828 try {
2929 const circuitJson = await getCircuitJsonFromContext ( ctx )
3030
31- const simulationExperimentId =
31+ let simulationExperimentId =
3232 ctx . url . searchParams . get ( "simulation_experiment_id" ) ??
3333 ctx . url . searchParams . get ( "simulationExperimentId" ) ??
3434 ctx . simulationExperimentId
3535
36+ if ( ! simulationExperimentId ) {
37+ const simulationExperiment = circuitJson ?. find (
38+ ( el : any ) => el . type === "simulation_experiment" ,
39+ )
40+ if ( simulationExperiment ) {
41+ simulationExperimentId = simulationExperiment . simulation_experiment_id
42+ }
43+ }
44+
3645 if ( ! simulationExperimentId ) {
3746 return new Response (
3847 JSON . stringify ( {
3948 ok : false ,
4049 error :
41- "simulation_experiment_id is required to render schematic simulation output " ,
50+ "simulation_experiment_id is required and could not be automatically determined " ,
4251 } ) ,
4352 { status : 400 , headers : { "Content-Type" : "application/json" } } ,
4453 )
You can’t perform that action at this time.
0 commit comments