diff --git a/packages/vsx-registry/src/browser/vsx-extension.tsx b/packages/vsx-registry/src/browser/vsx-extension.tsx
index f29a46cda6364..b5172cf9d4fcf 100644
--- a/packages/vsx-registry/src/browser/vsx-extension.tsx
+++ b/packages/vsx-registry/src/browser/vsx-extension.tsx
@@ -332,8 +332,8 @@ export class VSXExtensionComponent extends AbstractVSXExtensionComponent {
{displayName} {version}
- {downloadCount && {downloadCompactFormatter.format(downloadCount)}}
- {averageRating && {averageRating.toFixed(1)}}
+ {!!downloadCount && {downloadCompactFormatter.format(downloadCount)}}
+ {!!averageRating && {averageRating.toFixed(1)}}
{description}
@@ -369,9 +369,9 @@ export class VSXExtensionEditorComponent extends AbstractVSXExtensionComponent {
{this.renderNamespaceAccess()}
{publisher}
- {downloadCount &&
+ {!!downloadCount &&
{downloadFormatter.format(downloadCount)}}
- {averageRating && {this.renderStars()}}
+ {averageRating !== undefined && {this.renderStars()}}
{repository && Repository}
{license && {license}}
@@ -404,10 +404,8 @@ export class VSXExtensionEditorComponent extends AbstractVSXExtensionComponent {
}
protected renderStars(): React.ReactNode {
- const rating = this.props.extension.averageRating;
- if (typeof rating !== 'number') {
- return undefined;
- }
+ const rating = this.props.extension.averageRating || 0;
+
const renderStarAt = (position: number) => position <= rating ?
:
position > rating && position - rating < 1 ?