Fixed bad control statements
parent
b834cc4275
commit
f1c4685fa2
|
@ -21,11 +21,13 @@ function PeerList() {
|
||||||
self.getUser = async () => {
|
self.getUser = async () => {
|
||||||
let res; try {
|
let res; try {
|
||||||
res = await fetch(`${API_URL}/`)
|
res = await fetch(`${API_URL}/`)
|
||||||
} catch (err) || (!res.ok)
|
} catch (err) {
|
||||||
if (err) console.error(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)
|
if (res.status) console.log(res.status)
|
||||||
alert('Failed to contact API and load peers list. Check your wireguard connection. ')
|
alert('Failed to contact API and load peers list. Check your wireguard connection. ')
|
||||||
else {
|
} else {
|
||||||
let user; try {
|
let user; try {
|
||||||
user = await res.json()
|
user = await res.json()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue