Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions frontend/src/ts/pages/friends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ function updatePendingConnections(): void {
<td class="actions">
<button class="accepted" aria-label="accept" data-balloon-pos="up">
<i class="fas fa-check fa-fw"></i>
</button>
</button>
<button class="rejected" aria-label="reject" data-balloon-pos="up">
<i class="fas fa-times fa-fw"></i>
</button>
</button>
<button class="blocked" aria-label="block" data-balloon-pos="up">
<i class="fas fa-shield-alt fa-fw"></i>
</button>
Expand Down Expand Up @@ -304,7 +304,7 @@ function buildFriendRow(entry: Friend): HTMLTableRowElement {
entry.streak?.maxLength,
"longest streak",
)}" data-balloon-pos="up">
${formatStreak(entry.streak?.length)}
${formatStreak(entry.streak?.length)}
</span></td>
<td class="small"><span aria-label="${
top15?.details
Expand All @@ -318,7 +318,7 @@ function buildFriendRow(entry: Friend): HTMLTableRowElement {
}<div class="sub">${top60?.acc ?? "-"}</div></span></td>
<td class="actions">
${actions}

</td>
</tr>`;

Expand Down Expand Up @@ -367,14 +367,25 @@ function formatPb(entry?: PersonalBest):
details: "",
};

result.details = [
const details = [
`${getLanguageDisplayString(entry.language)}`,
`${result.wpm} wpm`,
`${result.acc} acc`,
`${result.raw} raw`,
`${result.con} con`,
`${dateFormat(entry.timestamp, "dd MMM yyyy")}`,
].join("\n");
];

if (entry.acc) {
details.push(`${result.acc} acc`);
}
if (entry.raw) {
details.push(`${result.raw} raw`);
}
if (entry.consistency) {
Copy link
Contributor

@Leonabcd123 Leonabcd123 Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not show consistency when it's 0%. Let's use a more specific if statement:

if (entry.consistency != null)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter doesn't let me use !=, so I did a check on 0 instead

details.push(`${result.con} con`);
}
if (entry.timestamp) {
details.push(`${dateFormat(entry.timestamp, "dd MMM yyyy")}`);
}

result.details = details.join("\n");

return result;
}
Expand Down
62 changes: 4 additions & 58 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.