diff options
Diffstat (limited to 'src/components/Card.js')
| -rw-r--r-- | src/components/Card.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/components/Card.js b/src/components/Card.js index ab0ec3f..4e7b0de 100644 --- a/src/components/Card.js +++ b/src/components/Card.js | |||
| @@ -47,6 +47,18 @@ export const Card = ({ direction = 'ltr' }) => { | |||
| 47 | } | 47 | } |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | const disableHidePassword = () => { | ||
| 51 | const isWEPWithPasswordLengthShorterThat5Characters = () => { | ||
| 52 | return network.encryptionMode === 'WEP' && network.password.length < 5 | ||
| 53 | ? true | ||
| 54 | : false; | ||
| 55 | }; | ||
| 56 | |||
| 57 | return network.encryptionMode === 'WPA' && network.password.length < 8 | ||
| 58 | ? true | ||
| 59 | : isWEPWithPasswordLengthShorterThat5Characters(); | ||
| 60 | }; | ||
| 61 | |||
| 50 | useEffect(() => { | 62 | useEffect(() => { |
| 51 | if (firstLoad.current && window.innerWidth < 500) { | 63 | if (firstLoad.current && window.innerWidth < 500) { |
| 52 | firstLoad.current = false; | 64 | firstLoad.current = false; |
| @@ -134,6 +146,7 @@ export const Card = ({ direction = 'ltr' }) => { | |||
| 134 | <input | 146 | <input |
| 135 | type="checkbox" | 147 | type="checkbox" |
| 136 | id="hide-password-checkbox" | 148 | id="hide-password-checkbox" |
| 149 | disabled={disableHidePassword()} | ||
| 137 | className={network.encryptionMode === 'nopass' ? 'hidden' : ''} | 150 | className={network.encryptionMode === 'nopass' ? 'hidden' : ''} |
| 138 | onChange={() => | 151 | onChange={() => |
| 139 | setNetwork({ | 152 | setNetwork({ |
