updatable topping

This commit is contained in:
pakintada@gmail.com 2024-01-22 09:11:38 +07:00
parent ecd88b2e27
commit cfd5c723c0

View file

@ -278,11 +278,13 @@ export class RecipeDetailsComponent implements OnInit {
// check length of toppinglist
console.log("tpl length", this.tpl.length, "original length", (this.rawRecipe! as any).ToppingSet.length);
for(let ti = 0; ti < this.tpl.length; ti++){
// check at the same index
if(!isEqual(this.tpl[ti][0], (this.rawRecipe as any).ToppingSet[ti])){
console.log('topping list changed', ti, this.tpl[ti][0], (this.rawRecipe as any).ToppingSet[ti]);
// update raw recipe
(this.rawRecipe as any).ToppingSet[ti] = this.tpl[ti][0];
console.log('after update topping', (this.rawRecipe as any).ToppingSet[ti]);
}
}