From 6a73ac0a331d14132249718439a90e783c65755e Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 17 Feb 2022 15:20:42 +0100 Subject: [PATCH] fixed editor leave warning --- vue/src/apps/RecipeEditView/RecipeEditView.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vue/src/apps/RecipeEditView/RecipeEditView.vue b/vue/src/apps/RecipeEditView/RecipeEditView.vue index 14ccd0c3f..215f9fb86 100644 --- a/vue/src/apps/RecipeEditView/RecipeEditView.vue +++ b/vue/src/apps/RecipeEditView/RecipeEditView.vue @@ -656,8 +656,8 @@ export default { }, warnPageLeave: function (event) { if (this.recipe_changed) { - event.returnValue = "" - return "" + event.returnValue = "this_string_cant_be_empty_because_of_firefox" + return "this_string_cant_be_empty_because_of_firefox" } }, loadRecipe: function () { @@ -672,8 +672,8 @@ export default { // set default visibility style for each component of the step this.recipe.steps.forEach((s) => { this.$set(s, "time_visible", s.time !== 0) - this.$set(s, "ingredients_visible", s.ingredients.length > 0) - this.$set(s, "instruction_visible", s.instruction !== "") + this.$set(s, "ingredients_visible", s.ingredients.length > 0 || this.recipe.steps.length === 1) + this.$set(s, "instruction_visible", s.instruction !== "" || this.recipe.steps.length === 1) this.$set(s, "step_recipe_visible", s.step_recipe !== null) this.$set(s, "file_visible", s.file !== null) })