Skip to content

Commit c422a7d

Browse files
committed
fallback to github login if a name is not set
1 parent 8f5d347 commit c422a7d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/ros2-design.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ $( document ).ready(function() {
4343
// Define function for updating logout button with user info
4444
var update_logout_btn = function(user) {
4545
// Update the logout button with user info
46+
var name = user.name;
47+
if (!name) {
48+
name = user.login;
49+
}
4650
$( 'button.login-btn' ).html(
47-
'<img class="gravatar" src="' + user.avatar_url + '"/> &nbsp;' + user.name + ', Logout');
51+
'<img class="gravatar" src="' + user.avatar_url + '"/> &nbsp;' + name + ', Logout');
4852
};
4953
// Check for an use if set the stored user info
5054
var stored_user = null;

0 commit comments

Comments
 (0)