Skip to content

Commit

Permalink
Handle null score
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed Jan 8, 2025
1 parent 8efbb7b commit 656c86a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frontend/src/lib/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export function getRequirementTitle(ref_id: string, name: string) {
return title;
}

export function displayScoreColor(value: number, max_score: number, inversedColors = false) {
export function displayScoreColor(value: number | null, max_score: number, inversedColors = false) {
value ??= 0;
value = (value * 100) / max_score;
if (inversedColors) {
if (value < 25) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<span class="badge {classesText} h-fit" style="background-color: {resultColor ?? '#d1d5db'};">
{leadResult}
</span>
<!-- score !== null && -->
{#if statusI18n !== 'notApplicable' && isScored}
<ProgressRadial
stroke={100}
Expand Down

0 comments on commit 656c86a

Please sign in to comment.