Skip to content

Commit 48e1d42

Browse files
author
Federico Izzo
authored
Merge pull request #11 from fedeizzo/staging
v0.0.3
2 parents c7c4f17 + 0a996ee commit 48e1d42

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/app/services/recipe.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ export class RecipeService {
9292
!(result instanceof ErrorWrapper) &&
9393
result.length < RecipeService.queryLimit
9494
) {
95-
const set = new Set<DocumentType<RecipeClass>>();
96-
result.forEach((i) => set.add(i));
95+
const map = new Map<String, DocumentType<RecipeClass>>();
96+
result.forEach((i) => map.set(i.id, i));
9797
const moreResults = await this.searchRemainingWithRegex(
9898
searchString,
9999
RecipeService.queryLimit - result.length
100100
);
101-
moreResults.forEach((i) => set.add(i));
102-
result = Array.from(set);
101+
moreResults.forEach((i) => map.set(i.id, i));
102+
result = Array.from(map.values());
103103
}
104104
if (result instanceof ErrorWrapper) {
105105
response.setValuesList(

0 commit comments

Comments
 (0)