[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: ignore outdated search responses (#788)

authored by

SHAMIL and committed by
GitHub
219ac17a 0b714d1e

+10
+10
app/composables/useNpmRegistry.ts
··· 337 337 338 338 const result = packumentToSearchResult(pkg, downloads?.downloads) 339 339 340 + // If query changed/outdated, return empty search response 341 + if (q !== toValue(query)) { 342 + return emptySearchResponse 343 + } 344 + 340 345 cache.value = { 341 346 query: q, 342 347 objects: [result], ··· 356 361 { signal }, 357 362 60, 358 363 ) 364 + 365 + // If query changed/outdated, return empty search response 366 + if (q !== toValue(query)) { 367 + return emptySearchResponse 368 + } 359 369 360 370 cache.value = { 361 371 query: q,