Skip to content

Commit caee016

Browse files
committed
fix: resolve avatar not displaying due to camelCase field mismatch
Signed-off-by: Sbragul26 <sbragul26@gmail.com>
1 parent 926d4e5 commit caee016

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

layouts/partials/navbar.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,19 +325,17 @@
325325
}
326326
};
327327
function getAvatarUrl(response) {
328-
if (
329-
response &&
330-
typeof response.avatar_url === "string" &&
331-
response.avatar_url.trim()
332-
) {
333-
return response.avatar_url.trim();
328+
const avatarUrl = response?.avatarUrl || response?.avatar_url;
329+
330+
if (typeof avatarUrl === "string" && avatarUrl.trim()) {
331+
return avatarUrl.trim();
334332
}
335333

336334
return "";
337335
}
338336

339337
function getUserProfileUrl(response) {
340-
const userId = response?.id;
338+
const userId = response?.id ?? response?.userId ?? response?.user_id;
341339
if (userId) {
342340
return `${cloudAppUrl}/user/${encodeURIComponent(userId)}`;
343341
}

0 commit comments

Comments
 (0)