Fixed bad control statements

master
Keith Irwin 2022-09-13 10:40:35 -06:00
parent b834cc4275
commit f1c4685fa2
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 4 additions and 2 deletions

View File

@ -21,11 +21,13 @@ function PeerList() {
self.getUser = async () => {
let res; try {
res = await fetch(`${API_URL}/`)
} catch (err) || (!res.ok)
} catch (err) {
if (err) console.error(err)
alert('Failed to contact API and load peers list. Check your wireguard connection. ')
} if (!res.ok) {
if (res.status) console.log(res.status)
alert('Failed to contact API and load peers list. Check your wireguard connection. ')
else {
} else {
let user; try {
user = await res.json()
} catch (err) {