Skip to content

Commit 45c491a

Browse files
committed
fix: follow the same pattern of edge with package page
1 parent 97fe246 commit 45c491a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/components/OgImage/ShareCard.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const hasTypes = computed(() =>
4949
)
5050
const moduleFormat = computed(() => (displayVersion.value?.type === 'module' ? 'ESM' : 'CJS'))
5151
const depsCount = computed(() => Object.keys(displayVersion.value?.dependencies ?? {}).length)
52-
const unpackedSize = computed(() => displayVersion.value?.dist?.unpackedSize ?? 0)
52+
const unpackedSize = computed(() => displayVersion.value?.dist?.unpackedSize ?? null)
5353
const publishedAt = computed(() => pkg.value?.time?.[version.value] ?? '')
5454
const weeklyDownloads = computed(() => downloads.value?.downloads ?? 0)
5555
const repoSlug = computed(() => {
@@ -143,6 +143,7 @@ const fontMono = "'Geist Mono'"
143143
>Types</span
144144
>
145145
<span
146+
v-if="displayVersion"
146147
class="flex items-center text-xl font-light py-1 px-[14px] rounded-[6px] leading-[1.6]"
147148
:style="{
148149
border: `1px solid ${theme.borderMuted}`,
@@ -245,7 +246,7 @@ const fontMono = "'Geist Mono'"
245246
<span
246247
class="text-2xl font-normal leading-none tracking-[-0.3px]"
247248
:style="{ color: theme.textMuted }"
248-
>{{ bytesFormatter.format(unpackedSize) }}</span
249+
>{{ unpackedSize !== null ? bytesFormatter.format(unpackedSize) : '-' }}</span
249250
>
250251
</div>
251252

0 commit comments

Comments
 (0)