Skip to content

Commit

Permalink
Added stars count to user starred section - format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arononak committed Mar 22, 2024
1 parent d791e98 commit 5012bb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion [email protected]/lib/status_bar_indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,15 @@ export class StatusBarIndicator extends PanelMenu.Button {
function toItem(e, textLengthLimiter) {
const stars = e[`stargazers_count`]

function formatNumber(stringNumber) {
return String(stringNumber).split(``).reverse().join(``).replace(/(\d{3})/g, `$1 `).split(``).reverse().join(``).trim();
}

return {
"iconName": `starred-symbolic`,
"text": e[`full_name`].slice(0, textLengthLimiter),
"callback": () => openUrl(e[`html_url`]),
"endButtonText": `${stars} stars`,
"endButtonText": `${formatNumber(stars)} stars`,
"endButtonCallback": () => { },
}
}
Expand Down
2 changes: 1 addition & 1 deletion [email protected]/lib/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = `3.19.0`
export const VERSION = `3.21.0`

0 comments on commit 5012bb7

Please sign in to comment.