Skip to content

Commit

Permalink
web/em-analysis: Fix slight logic change in future price addition commit
Browse files Browse the repository at this point in the history
Only modify timestamp_slot_count if prices are not empty.
  • Loading branch information
photron committed Nov 1, 2024
1 parent 122e23f commit f235737
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion software/web/src/modules/em_energy_analysis/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,6 @@ export class EMEnergyAnalysis extends Component<EMEnergyAnalysisProps, EMEnergyA
}
}

timestamp_slot_count = Math.max(timestamp_slot_count, energy_manager_data.price.length);
let price = undefined;
let price_empty = energy_manager_data.price_empty;

Expand Down Expand Up @@ -860,6 +859,8 @@ export class EMEnergyAnalysis extends Component<EMEnergyAnalysisProps, EMEnergyA
}

if (!price_empty) {
timestamp_slot_count = Math.max(timestamp_slot_count, energy_manager_data.price.length);

uplot_data.keys.push('em_price');
uplot_data.names.push(__("em_energy_analysis.script.price"));
uplot_data.values.push(price);
Expand Down

0 comments on commit f235737

Please sign in to comment.