Skip to content

Commit

Permalink
FIxed user section for /user email nullable field
Browse files Browse the repository at this point in the history
  • Loading branch information
arononak committed Aug 28, 2024
1 parent 91ff009 commit d7a6b68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions [email protected]/lib/status_bar_indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export class StatusBarIndicator extends PanelMenu.Button {
setUser(user, minutes) {
if (user === null || user === undefined) return

const userEmail = user[`email`]
const userEmail = user[`email`] == null && user[`email`] == undefined ? `No email` : user[`email`]
const userName = user[`name`]
const createdAt = user[`created_at`]
const userUrl = user[`html_url`]
Expand All @@ -583,7 +583,7 @@ export class StatusBarIndicator extends PanelMenu.Button {

const freeMinutesPercentage = 100 - Math.round((minutes[`total_minutes_used`] / minutes[`included_minutes`]) * 100)

const userLabelText = userName == null || userEmail == null
const userLabelText = userName == null
? `No permissions`
: `${userName} (${userEmail}) \n\nJoined GitHub on: ${DateFormatController.format(createdAt)}\nFree minutes: ${freeMinutesPercentage}%`

Expand Down

0 comments on commit d7a6b68

Please sign in to comment.