From f1c4685fa2e9b5d57a73b693091099823b35697c Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Tue, 13 Sep 2022 10:40:35 -0600 Subject: [PATCH] Fixed bad control statements --- front/dashboard.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/front/dashboard.js b/front/dashboard.js index 2021974..c83e025 100644 --- a/front/dashboard.js +++ b/front/dashboard.js @@ -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) {