From 21c6f819a0c452b01541e4c1bcabfaf27454e477 Mon Sep 17 00:00:00 2001 From: smilerz Date: Wed, 16 Feb 2022 14:19:58 -0600 Subject: [PATCH] start counting at zero --- vue/src/apps/RecipeEditView/RecipeEditView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vue/src/apps/RecipeEditView/RecipeEditView.vue b/vue/src/apps/RecipeEditView/RecipeEditView.vue index d005853e8..14ccd0c3f 100644 --- a/vue/src/apps/RecipeEditView/RecipeEditView.vue +++ b/vue/src/apps/RecipeEditView/RecipeEditView.vue @@ -969,7 +969,7 @@ export default { appendIngredients: function () { let ing_list = this.paste_ingredients.split(/\r?\n/) let step = this.recipe.steps.findIndex((x) => x.id == this.paste_step) - let order = Math.max(...this.recipe.steps[step].ingredients.map((x) => x.order), 0) + 1 + let order = Math.max(...this.recipe.steps[step].ingredients.map((x) => x.order), -1) + 1 this.recipe.steps[step].ingredients_visible = true ing_list.forEach((ing) => { if (ing.trim() !== "") {