fix: Fix ratio not appearing if downvotes are 0
This commit is contained in:
1 parent
bb8818b17b
commit
607fc7f837
2 files changed
+2
-2
No files matched your search
@@ -16,7 +16,7 @@
|
||||
|
||||
<Card class="bg-white flex flex-col w-full p-5 gap-2.5">
|
||||
<div class="flex flex-row w-full gap-2.5">
|
||||
<div class="flex flex-col gap-1 grow">
|
||||
<div class="flex flex-col gap-1.5 grow">
|
||||
<PostMeta
|
||||
community={post.community}
|
||||
user={post.creator}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<span>•</span>
|
||||
{/if}
|
||||
<RelativeDate date={published} />
|
||||
{#if upvotes && downvotes}
|
||||
{#if upvotes != undefined && downvotes != undefined}
|
||||
<span>•</span>
|
||||
<span>
|
||||
{Math.floor((upvotes / (upvotes + downvotes || 1)) * 100)}%
|
||||
|
||||
Reference in new issue
Block a user