From f44e63da011647962f83e825d9770e20c4305f01 Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Sun, 2 Jun 2024 01:32:54 +0200 Subject: [PATCH] fix for metacran that has no name --- static/sidebar.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/static/sidebar.js b/static/sidebar.js index 39907e4..a495ffd 100644 --- a/static/sidebar.js +++ b/static/sidebar.js @@ -54,12 +54,15 @@ function load_github_user_info(){ return github_api('/users/' + ghuser).then(function(user){ $("#github-user-name").text(user.name || ghuser); - // use same name->title format as GitHub itself - if(user.type === 'Organization'){ - $("title.default-fallback-title").text(`R packages by ${user.name}`); - } else { - $("title.default-fallback-title").text(`R packages by ${ghuser} (${user.name})`); + if(user.name){ + // use same name->title format as GitHub itself + if(user.type === 'Organization'){ + $("title.default-fallback-title").text(`R packages by ${user.name}`); + } else { + $("title.default-fallback-title").text(`R packages by ${ghuser} (${user.name})`); + } } + $("#github-user-bio").text(user.bio); if(user.company){ $("#github-user-company").toggleClass("d-none").find('.content').text(user.company);