Skip to content

Commit

Permalink
Fix const import
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Oct 18, 2024
1 parent fef22fd commit 14293b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
5 changes: 1 addition & 4 deletions src/scripts/components/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CallbackQueue from '@services/callback-queue.js';
import TIMER_STATES from '@services/timer.js';
import { TIMER_STATES } from '@services/timer.js';
import Util from '@services/util.js';
import MainAudio from './mixins/main-audio.js';
import MainInitialization from './mixins/main-initialization.js';
Expand All @@ -14,9 +14,6 @@ import './main.scss';
/** @constant {number} FOCUS_DELAY_MS Delay before focus is set. */
const FOCUS_DELAY_MS = 100;

/** @constant {number} CONVENIENCE_MARGIN_PX Extra margin for height limit. */
const CONVENIENCE_MARGIN_PX = 32;

/** @constant {number} MUSIC_FADE_TIME_MS Music fade time in ms. */
const MUSIC_FADE_TIME_MS = 2000;

Expand Down
9 changes: 2 additions & 7 deletions src/scripts/components/mixins/main-initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,8 @@ export default class MainInitialization {
if (params.isInitial && typeof previousState.timeLeft === 'number') {
this.resetTimer(previousState.timeLeft);
}
else if (
typeof this.params.globals.get('params').behaviour.timeLimitGlobal ===
'number'
) {
this.resetTimer(
this.params.globals.get('params').behaviour.timeLimitGlobal * MS_IN_S
);
else if (typeof this.params.globals.get('params').behaviour.timeLimitGlobal === 'number') {
this.resetTimer(this.params.globals.get('params').behaviour.timeLimitGlobal * MS_IN_S);
}

if (this.livesLeft === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/services/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default class Timer {
this.callbacks.onTick(newTime);
}

if (this.mode === BACKWARD && this.getTime() <= 0) {
if (this.mode === TIMER_MODES.BACKWARD && this.getTime() <= 0) {
this.stop();
this.callbacks.onExpired(0);
return;
Expand Down

0 comments on commit 14293b0

Please sign in to comment.