-
-
Pending Friend Requests
+
+
+ Incoming Requests
-
- Friends
-
+
- Friends
-
+
+
+
+ Friends
+
-
+
+
@@ -58,7 +63,7 @@
name
- friend since
+ friends for
level
{
}?isUid" router-link>${item.initiatorName}
${formatAge(item.addedAt)} ago
-
@@ -174,8 +174,22 @@ function buildFriendRow(entry: Friend): HTMLTableRowElement {
const top60 = formatPb(entry.top60);
const element = document.createElement("tr");
- element.dataset["id"] = entry.friendRequestId;
- element.innerHTML = `
+ element.dataset["id"] = entry.uid;
+
+ const isMe = entry.uid === getAuthenticatedUser()?.uid;
+
+ let actions = "";
+ if (isMe) {
+ element.classList.add("me");
+ } else {
+ actions = `
+
+
+
+
+ `;
+ }
+ element.innerHTML = `
@@ -193,7 +207,9 @@ function buildFriendRow(entry: Friend): HTMLTableRowElement {
- ${formatAge(entry.addedAt, "short")}
+ ${
+ entry.addedAt !== undefined ? formatAge(entry.addedAt, "short") : "-"
+ }
@@ -218,20 +234,16 @@ function buildFriendRow(entry: Friend): HTMLTableRowElement {
${
- top15?.wpm
- }${top15?.acc}
+ top15?.wpm ?? "-"
+ }${top15?.acc ?? "-"}
${
- top60?.wpm
- }${top60?.acc}
-
-
-
-
-
-
-
+ top60?.wpm ?? "-"
+ }${top60?.acc ?? "-"}
+
+ ${actions}
+
`;
@@ -312,7 +324,7 @@ function formatStreak(length?: number, prefix?: string): string {
: "";
}
-$("#friendAdd").on("click", () => {
+$(".pageFriends button.friendAdd").on("click", () => {
addFriendModal.show(undefined, {});
});
+
+ Friends
+
-
+
@@ -193,7 +207,9 @@ function buildFriendRow(entry: Friend): HTMLTableRowElement {
${top15?.acc}
${top15?.acc ?? "-"}
${top60?.acc}
${top60?.acc ?? "-"}