1
0
Fork 0
mirror of https://github.com/shouptech/tempgopher.git synced 2026-02-03 08:39:43 +00:00

Clear window interval before setting a new one

Fixes #17
This commit is contained in:
Emma 2018-10-26 09:08:16 -06:00
parent a167da2230
commit 1ce594d540

View file

@ -153,13 +153,15 @@ function appendData(data) {
"coolminutes": parseFloat(cmIn.val()),
"verbose": configData.verbose
}])
})
window.setInterval(renderThermostats, 60000);
});
window.clearInterval(rtHandle);
rtHandle = window.setInterval(renderThermostats, 60000);
renderThermostats();
});
var noButton = $("<button></button>").addClass("button").text("✘").click(function() {
window.setInterval(renderThermostats, 60000);
window.clearInterval(rtHandle);
rtHandle = window.setInterval(renderThermostats, 60000);
renderThermostats();
});