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