Skip to content

Commit 6960685

Browse files
committed
fix: follow the same failure pattern
1 parent f87f35a commit 6960685

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/composables/usePackageComparison.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface PackageComparisonData {
1616
package: ComparisonPackage
1717
downloads?: number
1818
/** Total likes from atproto */
19-
totalLikes: number
19+
totalLikes?: number
2020
/** Package's own unpacked size (from dist.unpackedSize) */
2121
packageSize?: number
2222
/** Number of direct dependencies */
@@ -115,10 +115,7 @@ export function usePackageComparison(packageNames: MaybeRefOrGetter<string[]>) {
115115
$fetch<VulnerabilityTreeResult>(`/api/registry/vulnerabilities/${name}`).catch(
116116
() => null,
117117
),
118-
$fetch<PackageLikes>(`/api/social/likes/${name}`).catch(() => ({
119-
totalLikes: 0,
120-
userHasLiked: false,
121-
})),
118+
$fetch<PackageLikes>(`/api/social/likes/${name}`).catch(() => null),
122119
])
123120
const versionData = pkgData.versions[latestVersion]
124121
const packageSize = versionData?.dist?.unpackedSize
@@ -166,7 +163,7 @@ export function usePackageComparison(packageNames: MaybeRefOrGetter<string[]>) {
166163
deprecated: versionData?.deprecated,
167164
},
168165
isBinaryOnly: isBinary,
169-
totalLikes: likes.totalLikes,
166+
totalLikes: likes?.totalLikes,
170167
}
171168
} catch {
172169
return null

0 commit comments

Comments
 (0)