fix: flashing to continue on navigation changes #11
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.
Refactored the flashing logic for both
Firmware Upgrade
andFlash Node
tabs into a global provider & context, allowing it to continue no matter the tab the user is currently at.The new context handles toasts and the reboot dialog (after
Firmware Upgrade
finishes), allowing it to report the status anywhere.Also, here are some edge cases I've covered:
The bundle size is at
1254 KB
. Bumped patch version to3.1.2
.Fixes #10
Caveat: Because React unmounts all unused components on navigation changes, I cannot keep the form states across tab changes. The tab will still report the progress for an ongoing flashing procedure, but the file and SHA-256 fields will be lost if the tab changes. If I store the form state in this new context, that would load the file into RAM... It does not sound like a good idea 😄