Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a typo in two places that was throwing an error in the console whenever you switch the Meter type (from steam to electricity for example). In addition to that, it was defaulting the Measurement to a value that would cause issues if the user just hit "ok" instead of changing the value to a valid one.
Fixing the typo
form[currentIndex].point = null
toform.sets[currentIndex].point = null
would clear the Measurement input completely after switching the Meter type, but this would not throw any errors and would still allow the user to hit "ok" and try to send the request, which would fail.I changed it so that when the Meter type is changed, the Measurement is set to whatever the first Measurement type is for that Meter type. The measurement can still be changed with the dropdown, but now if the user only changes the Meter and hits "ok" it will load a valid chart. This seems to work for all Meter changes between Steam, Electric, Solar, and Gas.