Don't validate hidden fields.
This commit is contained in:
parent
03dfa3de6f
commit
89fb6a7ac6
@ -7,6 +7,7 @@
|
|||||||
* Channel configuration:
|
* Channel configuration:
|
||||||
* Fix dark mode for buttons.
|
* Fix dark mode for buttons.
|
||||||
* Fix buttons margin.
|
* Fix buttons margin.
|
||||||
|
* Don't validate hidden fields.
|
||||||
* Help button on top of the "channels" page.
|
* Help button on top of the "channels" page.
|
||||||
|
|
||||||
## 8.0.0
|
## 8.0.0
|
||||||
|
@ -166,6 +166,10 @@ async function vivifyConfigurationChannel (
|
|||||||
const validateData: Function = async (channelConfigurationOptions: ChannelConfigurationOptions): Promise<boolean> => {
|
const validateData: Function = async (channelConfigurationOptions: ChannelConfigurationOptions): Promise<boolean> => {
|
||||||
const botConf = channelConfigurationOptions.bot
|
const botConf = channelConfigurationOptions.bot
|
||||||
const errorFieldSelectors = []
|
const errorFieldSelectors = []
|
||||||
|
|
||||||
|
// If !bot.enabled, we don't have to validate these fields:
|
||||||
|
// The backend will ignore those values.
|
||||||
|
if (botConf.enabled) {
|
||||||
if (/[^\p{L}\p{N}\p{Z}_-]/u.test(botConf.nickname ?? '')) {
|
if (/[^\p{L}\p{N}\p{Z}_-]/u.test(botConf.nickname ?? '')) {
|
||||||
const selector = '#peertube-livechat-bot-nickname'
|
const selector = '#peertube-livechat-bot-nickname'
|
||||||
errorFieldSelectors.push(selector)
|
errorFieldSelectors.push(selector)
|
||||||
@ -200,6 +204,7 @@ async function vivifyConfigurationChannel (
|
|||||||
await displayError(selector, message)
|
await displayError(selector, message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (errorFieldSelectors.length) {
|
if (errorFieldSelectors.length) {
|
||||||
// Set the focus to the first in-error field:
|
// Set the focus to the first in-error field:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user