Correction d'un bug qui empêchait la recherche de recette de fonctionner.

This commit is contained in:
FyloZ 2021-04-01 17:15:38 -04:00
parent ebfd4c9696
commit eef6eea40e
2 changed files with 8 additions and 4 deletions

View File

@ -11,8 +11,11 @@
</div>
</div>
<mat-expansion-panel class="table-title" *ngFor="let companyRecipes of (recipes$ | async)"
[hidden]="isCompanyHidden(companyRecipes.recipes)" [expanded]="panelForcedExpanded">
<mat-expansion-panel
class="table-title"
*ngFor="let companyRecipes of (recipes$ | async)"
[hidden]="isCompanyHidden(companyRecipes.recipes)"
[expanded]="panelForcedExpanded">
<mat-expansion-panel-header>
<mat-panel-title>
{{companyRecipes.company}}
@ -40,7 +43,8 @@
<ng-container matColumnDef="color">
<th mat-header-cell *matHeaderCellDef>Couleur</th>
<td mat-cell *matCellDef="let recipe">
<div class="recipe-color-circle" [class.light-mode]="isLightColor(recipe)" [style.backgroundColor]="recipe.color"></div>
<div class="recipe-color-circle" [class.light-mode]="isLightColor(recipe)"
[style.backgroundColor]="recipe.color"></div>
</td>
</ng-container>

View File

@ -41,7 +41,7 @@ export class ListComponent extends ErrorHandlingComponent {
}
const positive = this.searchString(recipe.name) ||
this.searchString(recipe.description) ||
this.searchString(recipe.sample.toString())
(recipe.sample && this.searchString(recipe.sample.toString()))
this.recipesHidden[recipe.id] = !positive
return positive
}