Skip to content

Commit

Permalink
Fixed vue error
Browse files Browse the repository at this point in the history
  • Loading branch information
mvaneijgen committed Jan 23, 2024
1 parent 17198c8 commit c885086
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 44 deletions.
46 changes: 24 additions & 22 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 --------------//
//--------------------------------//
Expand Down
46 changes: 24 additions & 22 deletions dist/drawsomething.html
Original file line number Diff line number Diff line change
Expand Up @@ -882,30 +882,32 @@ <h3>We could not fetch your settings at <i>{{url}}</i></h3>
},
// 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 --------------//
//--------------------------------//
Expand Down

0 comments on commit c885086

Please sign in to comment.