Skip to content

Commit

Permalink
v1.14 fix: give better mod error messages when passing a number
Browse files Browse the repository at this point in the history
  • Loading branch information
rianadon committed Oct 17, 2021
1 parent a0e1bc1 commit 05f9527
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/timer-bar-entity-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,11 @@ export class TimerBarEntityRow extends LitElement {
throw new Error('Mod format has changed! See the release notes and readme for details')
}

if (mod.remaining && mod.remaining.endsWith('%')) {
if (mod.remaining && typeof mod.remaining === 'string' && mod.remaining.endsWith('%')) {
if (percentRemaining <= parseFloat(mod.remaining)) config = { ...config, ...mod };
} else if (mod.remaining) {
if (remaining <= tryDurationToSeconds(mod.remaining, 'remaining')) config = { ...config, ...mod };
} else if (mod.elapsed && mod.elapsed.endsWith('%')) {
} else if (mod.elapsed && typeof mod.elapsed === 'string' && mod.elapsed.endsWith('%')) {
if (percentElapsed >= parseFloat(mod.elapsed)) config = { ...config, ...mod };
} else if (mod.elapsed) {
if (elapsed >= tryDurationToSeconds(mod.elapsed, 'elapsed')) config = { ...config, ...mod };
Expand Down

0 comments on commit 05f9527

Please sign in to comment.