Skip to content

Commit

Permalink
raidboss: fix test_timeline referencing window (#5885)
Browse files Browse the repository at this point in the history
  • Loading branch information
quisquous authored Nov 1, 2023
1 parent 2122ecd commit 157ac44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/raidboss/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ import {
//
// There's also no testing, sorry.

// TODO: we should also refactor uses of `window` out of here and maybe into
// set/clear timeout wrappers in html_timeline_ui as well.

const kBig = 1000000000; // Something bigger than any fight length in seconds.

const activeText = {
Expand Down Expand Up @@ -364,7 +367,7 @@ export class Timeline {
let activeEvent = this.activeEvents[0];
while (this.activeEvents.length && activeEvent && activeEvent.time <= fightNow) {
const event = activeEvent;
if (this.options.KeepExpiredTimerBarsForSeconds > 0) {
if (typeof window !== 'undefined' && this.options.KeepExpiredTimerBarsForSeconds > 0) {
this.keepAliveEvents.push({
event: event,
timeout: window.setTimeout(
Expand Down

0 comments on commit 157ac44

Please sign in to comment.