Skip to content

Commit

Permalink
Fixing imprecise comparison in durations (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
benwerd committed Sep 18, 2018
1 parent 2a9152d commit 88073b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unlock-app/src/utils/durations.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function durations(seconds, intervals) {
export function durationsAsTextFromSeconds(seconds) {
const d = durations(seconds, {})
const asArrayOfValues = Object.keys(d).map(duration => {
if (d[duration] != 1) { // Singular should only be used when there is exactly 1; otherwise plural is needed
if (d[duration] !== 1) { // Singular should only be used when there is exactly 1; otherwise plural is needed
return `${d[duration]} ${duration}`
}
return `${d[duration]} ${duration.slice(0, -1)}` // remove the s!
Expand Down

0 comments on commit 88073b8

Please sign in to comment.