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) {