Skip to content

Commit 051f1e2

Browse files
committed
fix: search result
1 parent 306d537 commit 051f1e2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/composables/useNpmRegistry.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ export function useNpmSearch(
337337

338338
const result = packumentToSearchResult(pkg, downloads?.downloads)
339339

340+
if (q !== toValue(query)) {
341+
return emptySearchResponse
342+
}
343+
340344
cache.value = {
341345
query: q,
342346
objects: [result],
@@ -357,6 +361,10 @@ export function useNpmSearch(
357361
60,
358362
)
359363

364+
if (q !== toValue(query)) {
365+
return emptySearchResponse
366+
}
367+
360368
cache.value = {
361369
query: q,
362370
objects: response.objects,

0 commit comments

Comments
 (0)