From 63d8e9789eb32140706e09aacc13fcf042a214ae Mon Sep 17 00:00:00 2001
From: John Livingston
Date: Thu, 13 Jun 2024 12:48:58 +0200
Subject: [PATCH] Fix: resetting validationError on update.
---
.../configuration/elements/channel-configuration.ts | 11 +++++++++++
.../common/configuration/elements/channel-emojis.ts | 11 +++++++++++
.../elements/templates/channel-configuration.ts | 5 ++++-
.../elements/templates/channel-emojis.ts | 3 ++-
4 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/client/common/configuration/elements/channel-configuration.ts b/client/common/configuration/elements/channel-configuration.ts
index 71e72c94..6a571f19 100644
--- a/client/common/configuration/elements/channel-configuration.ts
+++ b/client/common/configuration/elements/channel-configuration.ts
@@ -61,6 +61,17 @@ export class ChannelConfigurationElement extends LivechatElement {
this.requestUpdate()
}
+ /**
+ * Resets the validation errors.
+ * @param ev the vent
+ */
+ public resetValidation (_ev?: Event): void {
+ if (this.validationError) {
+ this.validationError = undefined
+ this.requestUpdate('_validationError')
+ }
+ }
+
/**
* Saves the channel configuration.
* @param event event
diff --git a/client/common/configuration/elements/channel-emojis.ts b/client/common/configuration/elements/channel-emojis.ts
index e881d077..914b8461 100644
--- a/client/common/configuration/elements/channel-emojis.ts
+++ b/client/common/configuration/elements/channel-emojis.ts
@@ -71,6 +71,17 @@ export class ChannelEmojisElement extends LivechatElement {
this.requestUpdate()
}
+ /**
+ * Resets the validation errors.
+ * @param ev the vent
+ */
+ public resetValidation (_ev?: Event): void {
+ if (this.validationError) {
+ this.validationError = undefined
+ this.requestUpdate('_validationError')
+ }
+ }
+
/**
* Saves the emojis form.
* @param ev event
diff --git a/client/common/configuration/elements/templates/channel-configuration.ts b/client/common/configuration/elements/templates/channel-configuration.ts
index 2bab2d6a..fc20983d 100644
--- a/client/common/configuration/elements/templates/channel-configuration.ts
+++ b/client/common/configuration/elements/templates/channel-configuration.ts
@@ -126,7 +126,7 @@ export function tplChannelConfiguration (el: ChannelConfigurationElement): Templ
-