mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
.interval_kill_all method enhancements / bugfix
This commit is contained in:
parent
3c87a5965c
commit
d92704c374
1 changed files with 8 additions and 6 deletions
|
@ -89,7 +89,7 @@ GUI_control.prototype.interval_resume = function(name) {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// input = array of timers thats meant to be kept
|
// input = array of timers thats meant to be kept, or nothing
|
||||||
// return = returns timers killed in last call
|
// return = returns timers killed in last call
|
||||||
GUI_control.prototype.interval_kill_all = function(keep_array) {
|
GUI_control.prototype.interval_kill_all = function(keep_array) {
|
||||||
var timers_killed = 0;
|
var timers_killed = 0;
|
||||||
|
@ -98,11 +98,13 @@ GUI_control.prototype.interval_kill_all = function(keep_array) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var keep = false;
|
var keep = false;
|
||||||
|
if (keep_array) { // only run through the array if it exists
|
||||||
keep_array.forEach(function(name) {
|
keep_array.forEach(function(name) {
|
||||||
if (self.interval_array[i].name == name) {
|
if (self.interval_array[i].name == name) {
|
||||||
keep = true;
|
keep = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (!keep) {
|
if (!keep) {
|
||||||
clearInterval(this.interval_array[i].timer); // stop timer
|
clearInterval(this.interval_array[i].timer); // stop timer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue