Skip to content

Commit 54f6135

Browse files
committed
fix: guard hasMore against empty username to prevent infinite loadAll loop
1 parent 6d9abc6 commit 54f6135

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/composables/npm/useUserPackages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export function useUserPackages(username: MaybeRefOrGetter<string>) {
215215

216216
/** Whether there are more results available to load (npm path only) */
217217
const hasMore = computed(() => {
218+
if (!toValue(username)) return false
218219
// Algolia fetches everything in one request; only npm needs pagination
219220
if (activeProvider.value !== 'npm') return false
220221
if (!cache.value) return true

0 commit comments

Comments
 (0)