diff options
| author | olekstomek <olekstomek@gmail.com> | 2021-07-30 19:42:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-30 10:42:22 -0700 |
| commit | 02338896e0438da05735d9a461d1943d17114ef2 (patch) | |
| tree | 60e2ab989693b6ebc72913ba7ca7363a2f484e37 /src/components/Card.js | |
| parent | d240bc3db52495899b93335ad561c4de6d79ad48 (diff) | |
remember the password even if it is cleared by the None option (#127)
* remember the password even if it is cleared by the None option
* refactor remembering password after code review
* fixes: label and checking encryption mode for saving password
Diffstat (limited to 'src/components/Card.js')
| -rw-r--r-- | src/components/Card.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/components/Card.js b/src/components/Card.js index 6818320..9dfd098 100644 --- a/src/components/Card.js +++ b/src/components/Card.js | |||
| @@ -65,7 +65,8 @@ export const Card = ({ direction = 'ltr' }) => { | |||
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | const ssid = escape(network.ssid); | 67 | const ssid = escape(network.ssid); |
| 68 | const password = escape(network.password); | 68 | const password = |
| 69 | network.encryptionMode === 'nopass' ? '' : escape(network.password); | ||
| 69 | setQrvalue(`WIFI:T:${network.encryptionMode};S:${ssid};P:${password};;`); | 70 | setQrvalue(`WIFI:T:${network.encryptionMode};S:${ssid};P:${password};;`); |
| 70 | }, [network]); | 71 | }, [network]); |
| 71 | 72 | ||
| @@ -178,8 +179,6 @@ export const Card = ({ direction = 'ltr' }) => { | |||
| 178 | setNetwork({ | 179 | setNetwork({ |
| 179 | ...network, | 180 | ...network, |
| 180 | encryptionMode: e.target.value, | 181 | encryptionMode: e.target.value, |
| 181 | password: '', | ||
| 182 | hidePassword: false, | ||
| 183 | }); | 182 | }); |
| 184 | }} | 183 | }} |
| 185 | /> | 184 | /> |
