From c885086ff3d6849d12ca55c0c15128440ae92ae3 Mon Sep 17 00:00:00 2001 From: mvaneijgen Date: Tue, 23 Jan 2024 12:42:36 +0100 Subject: [PATCH] Fixed vue error --- assets/js/script.js | 46 +++++++++++++++++++++-------------------- dist/drawsomething.html | 46 +++++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/assets/js/script.js b/assets/js/script.js index d90cc1b..6057ba0 100755 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -151,30 +151,32 @@ const App = { }, // GET request get: function () { - fetch(this.url, { - method: "GET", - headers: { - "Content-type": "application/json; charset=UTF-8" - } - }) - .then((response) => { - return response.json(); - }) - .then((data) => { - console.log(data); - this.x = data.info.leds.matrix.w; - this.y = data.info.leds.matrix.h; - this.options = false; - this.loading = false; - if (!localStorage.fill) { - this.setupColors(); + if (!this.ignore) { + fetch(this.url, { + method: "GET", + headers: { + "Content-type": "application/json; charset=UTF-8" } }) - .catch((error) => { - this.options = true; - // this.options = true; - console.error("Fetch Error:", error); - }); + .then((response) => { + return response.json(); + }) + .then((data) => { + console.log(data); + this.x = data.info.leds.matrix.w; + this.y = data.info.leds.matrix.h; + this.options = false; + this.loading = false; + if (!localStorage.fill) { + this.setupColors(); + } + }) + .catch((error) => { + this.options = true; + // this.options = true; + console.error("Fetch Error:", error); + }); + } }, // END 🐵 Send API request --------------// //--------------------------------// diff --git a/dist/drawsomething.html b/dist/drawsomething.html index 359a0fd..8a29a66 100644 --- a/dist/drawsomething.html +++ b/dist/drawsomething.html @@ -882,30 +882,32 @@

We could not fetch your settings at {{url}}

}, // GET request get: function () { - fetch(this.url, { - method: "GET", - headers: { - "Content-type": "application/json; charset=UTF-8" - } - }) - .then((response) => { - return response.json(); - }) - .then((data) => { - console.log(data); - this.x = data.info.leds.matrix.w; - this.y = data.info.leds.matrix.h; - this.options = false; - this.loading = false; - if (!localStorage.fill) { - this.setupColors(); + if (!this.ignore) { + fetch(this.url, { + method: "GET", + headers: { + "Content-type": "application/json; charset=UTF-8" } }) - .catch((error) => { - this.options = true; - // this.options = true; - console.error("Fetch Error:", error); - }); + .then((response) => { + return response.json(); + }) + .then((data) => { + console.log(data); + this.x = data.info.leds.matrix.w; + this.y = data.info.leds.matrix.h; + this.options = false; + this.loading = false; + if (!localStorage.fill) { + this.setupColors(); + } + }) + .catch((error) => { + this.options = true; + // this.options = true; + console.error("Fetch Error:", error); + }); + } }, // END 🐵 Send API request --------------// //--------------------------------//