Fix DownloadImageModal submit button being disabled when switching from a device type that has wifi network capability to one that does not#1621
Conversation
|
|
||
| return formModel.network === 'wifi' && !formModel.wifiSsid; | ||
| if ( | ||
| (deviceType.options?.filter((option) => option.name === 'network') ?? []) |
There was a problem hiding this comment.
Could we instead try to clear the state properties that are not in the options any more?
Then the title would become:
DownloadImageModal: Fix disabling submit when switching between DTs that have different options
There was a problem hiding this comment.
If we clear the state properties of options that are not there anymore, that means we will also lose the input the user stored for wifi credentials when they go from wifi -> no wifi -> wifi (currently if I enter a network and password, then switch to a DT with no wifi, then switch back to a DT with wifi, the network and password I entered remain). All of this data on the model state. So we cannot just clear all state that is not relevant to the current DT because then if the user switches back and forth between DTs, we would be inconveniencing them by making them re-enter all the data they entered priorly. Perhaps we don't want the data persisting anyway though, what do you think about it all? @thgreasi
…om a device type that has wifi network capability to one that does not Change-type: patch Signed-off-by: Matthew Yarmolinsky <matthew-timothy@balena.io>
083d5f7 to
1efba33
Compare
Fix DownloadImageModal submit button being disabled when switching from a device type that has wifi network capability to one that does not
Change-type: patch
Signed-off-by: Matthew Yarmolinsky matthew-timothy@balena.io
Contributor checklist
npm run generate-snapshotsReviewer Guidelines