Bump the local storage key for saved form values #159
Merged
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.
Description
In #158 I changed the constants that identify projects. I didn't
realize this would break the calculator for users who had the old
constants in local storage (as saved form values).
This is the simplest solution: change the local storage key for saved
form values, which will effectively clear the stored values for
everyone, one time.
There's no attempt to migrate the old values. We would have to support
that code indefinitely (unless we eventually cleared storage anyway),
and I don't think there's a ton of value in preserving form prefills.
The old key will still be there in users' local storage; if we want,
we can follow up with a change to delete it.
Test Plan
Before making this change, reproed the problem by manually editing
local storage and changing the
RA-calc-form-values
value to have theold constant
heat_pump_clothes_dryer
in theprojects
field. Submitthe form and make sure there was an error (trying to read
shortLabel
of
undefined
).Apply this change, make sure the form is reset to defaults, and
submitting it doesn't cause an error, and results show up.