Skip to content

Commit ce75b95

Browse files
Jacob-TateIgnisDa
andauthored
Fixed bug in review score rendering (#949)
* Fixed bug in review score rendering * chore(frontend): use `null` in place of `undefined` --------- Co-authored-by: Diptesh Choudhuri <ignisda2001@gmail.com>
1 parent 2d4da19 commit ce75b95

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

apps/frontend/app/components/media.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -601,14 +601,11 @@ export const MetadataDisplayItem = (props: {
601601
<Group gap={4}>
602602
<IconStarFilled size={12} style={{ color: "#EBE600FF" }} />
603603
<Text c="white" size="xs" fw="bold" pr={4}>
604-
{match(userPreferences.general.reviewScale)
605-
.with(UserReviewScale.OutOfFive, () =>
606-
Number.parseFloat(averageRating.toString()).toFixed(1),
607-
)
608-
.with(UserReviewScale.OutOfHundred, () => averageRating)
609-
.exhaustive()}
604+
{Number(averageRating) % 1 === 0
605+
? Math.round(Number(averageRating)).toString()
606+
: Number(averageRating).toFixed(1)}
610607
{userPreferences.general.reviewScale === UserReviewScale.OutOfFive
611-
? undefined
608+
? null
612609
: " %"}
613610
</Text>
614611
</Group>

0 commit comments

Comments
 (0)