From 5fcdd07be4fdf638d03b37ce34b119454eb1a065 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 29 Jul 2022 19:56:15 +0200 Subject: [PATCH] Show error text if you can't connect to the local server --- src/App.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 58320ec..58153fc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,7 +13,7 @@ @@ -55,7 +55,8 @@ export default { }, data() { return { - isSocketConnected: false + isSocketConnected: false, + loadingText: "Connecting to local server..." } }, mounted() { @@ -64,6 +65,10 @@ export default { console.log('Connected to WebSocket') this.isSocketConnected = true }) + socket.addEventListener('error', (event) => { + console.log(event) + this.loadingText = "Couldn't connect to local server." + }) } }