diff options
| -rw-r--r-- | src/components/Card.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/components/Card.js b/src/components/Card.js index 0011ca8..c301bbe 100644 --- a/src/components/Card.js +++ b/src/components/Card.js | |||
| @@ -29,15 +29,19 @@ export const Card = () => { | |||
| 29 | }; | 29 | }; |
| 30 | 30 | ||
| 31 | const onPrint = () => { | 31 | const onPrint = () => { |
| 32 | if (network.password.length < 8 && network.encryptionMode === 'WPA') { | 32 | if (network.ssid.length > 0) { |
| 33 | alert('Password must be at least 8 characters'); | 33 | if (network.password.length < 8 && network.encryptionMode === 'WPA') { |
| 34 | } else if ( | 34 | alert('Password must be at least 8 characters'); |
| 35 | network.password.length < 5 && | 35 | } else if ( |
| 36 | network.encryptionMode === 'WEP' | 36 | network.password.length < 5 && |
| 37 | ) { | 37 | network.encryptionMode === 'WEP' |
| 38 | alert('Password must be at least 5 characters'); | 38 | ) { |
| 39 | alert('Password must be at least 5 characters'); | ||
| 40 | } else { | ||
| 41 | window.print(); | ||
| 42 | } | ||
| 39 | } else { | 43 | } else { |
| 40 | window.print(); | 44 | alert('Network name cannot be empty'); |
| 41 | } | 45 | } |
| 42 | }; | 46 | }; |
| 43 | 47 | ||
