fix: leaderboard loading issue
This commit is contained in:
parent
3ab10c6758
commit
f027df06d1
|
@ -355,17 +355,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-3 py-1 text-right font-medium text-gray-900 dark:text-white w-max">
|
|
||||||
<div class=" flex justify-end">
|
{#if feedback?.data?.rating}
|
||||||
{#if feedback.data.rating.toString() === '1'}
|
<td class="px-3 py-1 text-right font-medium text-gray-900 dark:text-white w-max">
|
||||||
<Badge type="info" content={$i18n.t('Won')} />
|
<div class=" flex justify-end">
|
||||||
{:else if feedback.data.rating.toString() === '0'}
|
{#if feedback?.data?.rating.toString() === '1'}
|
||||||
<Badge type="muted" content={$i18n.t('Draw')} />
|
<Badge type="info" content={$i18n.t('Won')} />
|
||||||
{:else if feedback.data.rating.toString() === '-1'}
|
{:else if feedback?.data?.rating.toString() === '0'}
|
||||||
<Badge type="error" content={$i18n.t('Lost')} />
|
<Badge type="muted" content={$i18n.t('Draw')} />
|
||||||
{/if}
|
{:else if feedback?.data?.rating.toString() === '-1'}
|
||||||
</div>
|
<Badge type="error" content={$i18n.t('Lost')} />
|
||||||
</td>
|
{/if}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<td class=" px-3 py-1 text-right font-medium">
|
<td class=" px-3 py-1 text-right font-medium">
|
||||||
{dayjs(feedback.updated_at * 1000).fromNow()}
|
{dayjs(feedback.updated_at * 1000).fromNow()}
|
||||||
|
|
|
@ -151,6 +151,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
feedbacks.forEach((feedback) => {
|
feedbacks.forEach((feedback) => {
|
||||||
|
if (!feedback?.data?.model_id || !feedback?.data?.rating) return;
|
||||||
|
|
||||||
const modelA = feedback.data.model_id;
|
const modelA = feedback.data.model_id;
|
||||||
const statsA = getOrDefaultStats(modelA);
|
const statsA = getOrDefaultStats(modelA);
|
||||||
let outcome: number;
|
let outcome: number;
|
||||||
|
|
Loading…
Reference in New Issue