Forgot to reset failed attempts counter if the api request succeeds
This commit is contained in:
parent
81cb89af88
commit
dda2eff4c4
@ -39,7 +39,6 @@ window.addEventListener("load", async function () {
|
|||||||
try{
|
try{
|
||||||
var response = await fetch(api.url);
|
var response = await fetch(api.url);
|
||||||
if (!response.ok){
|
if (!response.ok){
|
||||||
|
|
||||||
throw new Error(response.status);
|
throw new Error(response.status);
|
||||||
}
|
}
|
||||||
json = await response.json();
|
json = await response.json();
|
||||||
@ -233,6 +232,8 @@ async function increment() {
|
|||||||
throw new Error(response.status);
|
throw new Error(response.status);
|
||||||
}
|
}
|
||||||
var json = await response.json();
|
var json = await response.json();
|
||||||
|
api.failedAttempts = 0;
|
||||||
|
|
||||||
for (var i = 1; i < resolution; i++){
|
for (var i = 1; i < resolution; i++){
|
||||||
cpu.data.datasets[0].data[i - 1] = cpu.data.datasets[0].data[i];
|
cpu.data.datasets[0].data[i - 1] = cpu.data.datasets[0].data[i];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user