Closed paullryan closed 8 years ago
Seems related to #4
Nevermind: See PR #6
Maybe something like
Idle.prototype.timeout = function () {
this.stopKeepalive();
this.toggleInterrupts(false);
this.safeClearInterval('idleHandle');
this.safeClearInterval('timeoutHandle');
this.idling = true;
this.running = false;
this.timedOut = true;
this.countdown = 0;
this.onTimeout.emit(null);
};
Idle.prototype.toggleState = function () {
var _this = this;
this.idling = !this.idling;
if (this.timedOut) {
this.toggleInterrupts(false);
}
if (this.idling) {
this.onIdleStart.emit(null);
this.stopKeepalive();
if (this.timeoutVal > 0) {
this.countdown = this.timeoutVal;
this.doCountdown();
this.timeoutHandle = setInterval(function () { _this.doCountdown(); }, 1000);
}
}
else {
this.timedOut = false;
this.toggleInterrupts(true);
this.onIdleEnd.emit(null);
this.startKeepalive();
}
this.safeClearInterval('idleHandle');
};
Fixed in d8d600d
Currently in Idle.prototype.toggleState when idleStart triggers it triggers the this.toggleInterrupts(false) which never allows idleEnd to occur. Seems like there needs to be one more condition here of not just this.idling but also the parent that called toggleState.