Skip to content

Commit c67ddbc

Browse files
committed
style: use isSafeNumber for conditions
1 parent 017f34a commit c67ddbc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

frontend/src/ts/pages/friends.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,16 +372,16 @@ function formatPb(entry?: PersonalBest):
372372
`${result.wpm} wpm`,
373373
];
374374

375-
if (entry.acc || entry.acc === 0) {
375+
if (isSafeNumber(entry.acc)) {
376376
details.push(`${result.acc} acc`);
377377
}
378-
if (entry.raw || entry.raw === 0) {
378+
if (isSafeNumber(entry.raw)) {
379379
details.push(`${result.raw} raw`);
380380
}
381-
if (entry.consistency || entry.consistency === 0) {
381+
if (isSafeNumber(entry.consistency)) {
382382
details.push(`${result.con} con`);
383383
}
384-
if (entry.timestamp) {
384+
if (isSafeNumber(entry.timestamp)) {
385385
details.push(`${dateFormat(entry.timestamp, "dd MMM yyyy")}`);
386386
}
387387

0 commit comments

Comments
 (0)