From 6ee3e94abb82b6a9b8a951536a15957b700066bb Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Tue, 15 Oct 2024 10:07:36 +0200 Subject: [PATCH] Clear errors and fields when hiding modal --- ui/src/components/CreateOrEditTask.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ui/src/components/CreateOrEditTask.vue b/ui/src/components/CreateOrEditTask.vue index 8f2c1b9..788a2f2 100644 --- a/ui/src/components/CreateOrEditTask.vue +++ b/ui/src/components/CreateOrEditTask.vue @@ -284,10 +284,8 @@ export default { this.cronEnabled = this.task.cron_enabled; } else { // hiding modal - - if (this.isEditing) { - this.clearFields(); - } + this.clearErrors(); + this.clearFields(); } }, }, @@ -349,10 +347,7 @@ export default { } isValidationOk = false; } - if ( - this.folderSynchronization == "exclusion" && - !this.exclude - ) { + if (this.folderSynchronization == "exclusion" && !this.exclude) { this.error.exclude = "common.required"; if (isValidationOk) { @@ -455,6 +450,7 @@ export default { }, onModalHidden() { this.clearErrors(); + this.clearFields(); this.$emit("hide"); }, },