Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Meter change issue #290

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Fixed Meter change issue #290

merged 1 commit into from
Jan 2, 2024

Conversation

s-egge
Copy link
Member

@s-egge s-egge commented Dec 31, 2023

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.

image

Fixing the typo form[currentIndex].point = null to form.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.

@s-egge s-egge linked an issue Dec 31, 2023 that may be closed by this pull request
Copy link
Contributor

@solderq35 solderq35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@solderq35 solderq35 merged commit c7818d2 into master Jan 2, 2024
3 checks passed
@s-egge s-egge deleted the edit-block-meter-change-bug branch July 1, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit Block Meter Bug
2 participants