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

-
+ { + el.resetValidation(e) if (el.channelConfiguration) { el.channelConfiguration.configuration.bot.forbiddenWords = e.detail el.requestUpdate('channelConfiguration') @@ -251,6 +252,7 @@ export function tplChannelConfiguration (el: ChannelConfigurationElement): Templ .validationPrefix=${'bot.quotes'} .rows=${el.channelConfiguration?.configuration.bot.quotes} @update=${(e: CustomEvent) => { + el.resetValidation(e) if (el.channelConfiguration) { el.channelConfiguration.configuration.bot.quotes = e.detail el.requestUpdate('channelConfiguration') @@ -272,6 +274,7 @@ export function tplChannelConfiguration (el: ChannelConfigurationElement): Templ .validationPrefix=${'bot.commands'} .rows=${el.channelConfiguration?.configuration.bot.commands} @update=${(e: CustomEvent) => { + el.resetValidation(e) if (el.channelConfiguration) { el.channelConfiguration.configuration.bot.commands = e.detail el.requestUpdate('channelConfiguration') diff --git a/client/common/configuration/elements/templates/channel-emojis.ts b/client/common/configuration/elements/templates/channel-emojis.ts index 5c021de4..0009ff06 100644 --- a/client/common/configuration/elements/templates/channel-emojis.ts +++ b/client/common/configuration/elements/templates/channel-emojis.ts @@ -52,7 +52,7 @@ export function tplChannelEmojis (el: ChannelEmojisElement): TemplateResult {

- +
${ el.channelEmojisConfiguration?.emojis?.customEmojis?.length @@ -88,6 +88,7 @@ export function tplChannelEmojis (el: ChannelEmojisElement): TemplateResult { .validationPrefix=${'emojis'} .rows=${el.channelEmojisConfiguration?.emojis.customEmojis} @update=${(e: CustomEvent) => { + el.resetValidation(e) if (el.channelEmojisConfiguration) { el.channelEmojisConfiguration.emojis.customEmojis = e.detail // Fixing missing ':' for shortnames: