Commit 6a1526e
committed
frontend: refactor passphrase.tsx
Refactor passphrase.tsx to be more concise easier to understand and less
error prone.
- Set passphraseEnabled to decide whether to display the disable or the
enable wizard.
- When one wizard is rendered it knows the status of the
passphraseEnabled. Also the disable wizard does not need to know about
the steps. The enable wizard knows where to start end stop and can
manage that state on its own.
- SetPassphrase is more explicit and less error prone than toggling it.
- Remove unnecessary API request after receiving a successful response
after setting the passphrase on the device.
- Remove some code duplication when rendering steps1 parent 034a351 commit 6a1526e
1 file changed
+89
-217
lines changed
0 commit comments