[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: deduplicate packages in user packages page. (#592)

authored by

Breno A. and committed by
GitHub
c0a11fd1 f5ae776f

+3 -1
+3 -1
app/composables/useNpmRegistry.ts
··· 382 382 383 383 // Update cache 384 384 if (cache.value && cache.value.query === q) { 385 + const existingNames = new Set(cache.value.objects.map(obj => obj.package.name)) 386 + const newObjects = response.objects.filter(obj => !existingNames.has(obj.package.name)) 385 387 cache.value = { 386 388 query: q, 387 - objects: [...cache.value.objects, ...response.objects], 389 + objects: [...cache.value.objects, ...newObjects], 388 390 total: response.total, 389 391 } 390 392 } else {