Skip to content

Commit

Permalink
fix(ranking): 当 delta 不存在时,则不需要显示 delta 和 newRating
Browse files Browse the repository at this point in the history
  • Loading branch information
XYShaoKang committed Apr 16, 2023
1 parent ee19af1 commit a8b3e8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content/pages/ranking/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ export const Item: FC<ItmeType> = memo(function Item({
if (!oldRating) return <></>

let deltaEl, newRatingEl
if (delta === undefined) {
if (typeof delta !== 'number') {
deltaEl = <></>
newRatingEl = <></>
} else {
const deltaNum = Number((delta ?? 0).toFixed(1))
const deltaNum = Number(delta.toFixed(1))
deltaEl = (
<div
css={css`
Expand Down

0 comments on commit a8b3e8b

Please sign in to comment.