OpenEnergyDashboard / OED

Open Energy Dashboard (OED)
Mozilla Public License 2.0
83 stars 316 forks source link

Default meter select #1348

Closed nneni closed 1 month ago

nneni commented 1 month ago

Description

Fixes #1186

Utilized React's useEffect hook to manage which option is selected when there is only one option (the only available choice, by default).

Type of change

Checklist

Limitations

None, at first the code was too specific and only applied to one of the data categories but after reanalysis it was rewritten to work in a more general sense.

mmehta2669 commented 1 month ago

The code looks good, and very clear wit the functionality. it works and I'm personally not familiar with the nuances of react to determine if there is a better solution.

Rakesh-Ranga-Buram commented 1 month ago

Everything looks good to me. Please convert this draft to PR.

huss commented 1 month ago

This is a note to be sure that PR #1314 does similar logic/effect or to get them in sync. This does not directly impact this PR.

nneni commented 1 month ago

Thanks for catching those! Just made the edits and pushed them.