fix bug with redundant play/pause events, fix spec, tweak current moderator css

This commit is contained in:
AlecM33
2023-04-08 16:01:39 -04:00
parent f1a5df94e2
commit bef8cd8d59
6 changed files with 25 additions and 22 deletions

View File

@@ -66,26 +66,29 @@ class ServerTimer {
}
stopTimer () {
this.logger.debug('STOPPING TIMER');
if (this.ticking) {
this.logger.debug('STOPPING TIMER');
clearTimeout(this.ticking);
this.ticking = null;
}
}
resumeTimer () {
this.logger.debug('RESUMING TIMER FOR ' + this.currentTimeInMillis + 'ms');
this.start = Date.now();
this.totalTime = this.currentTimeInMillis;
const expected = Date.now() + this.tickInterval;
const instance = this;
this.ticking = setTimeout(function () {
stepFn(
instance,
expected
);
}, this.tickInterval);
if (!this.ticking) {
this.logger.debug('RESUMING TIMER FOR ' + this.currentTimeInMillis + 'ms');
this.start = Date.now();
this.totalTime = this.currentTimeInMillis;
const expected = Date.now() + this.tickInterval;
const instance = this;
this.ticking = setTimeout(function () {
stepFn(
instance,
expected
);
}, this.tickInterval);
return this.timesUpPromise;
return this.timesUpPromise;
}
}
}

View File

@@ -59,7 +59,7 @@ class EventManager {
try {
messageComponents = message.split(';', 3);
if (messageComponents[messageComponents.length - 1] === this.instanceId) {
this.logger.trace('Disregarding self-authored message');
this.logger.debug('Disregarding self-authored message');
return;
}
args = JSON.parse(