Slow mode duration:
* channel option is no more a default value, but the current value * changing naming in accordance * changing labels and documentation
This commit is contained in:
@ -165,16 +165,16 @@ async function vivifyConfigurationChannel (
|
||||
|
||||
const validateData: Function = async (channelConfigurationOptions: ChannelConfigurationOptions): Promise<boolean> => {
|
||||
const botConf = channelConfigurationOptions.bot
|
||||
const slowModeDefaultDuration = channelConfigurationOptions.slowMode.defaultDuration
|
||||
const slowModeDuration = channelConfigurationOptions.slowMode.duration
|
||||
const errorFieldSelectors = []
|
||||
|
||||
if (
|
||||
(typeof slowModeDefaultDuration !== 'number') ||
|
||||
isNaN(slowModeDefaultDuration) ||
|
||||
slowModeDefaultDuration < 0 ||
|
||||
slowModeDefaultDuration > 1000
|
||||
(typeof slowModeDuration !== 'number') ||
|
||||
isNaN(slowModeDuration) ||
|
||||
slowModeDuration < 0 ||
|
||||
slowModeDuration > 1000
|
||||
) {
|
||||
const selector = '#peertube-livechat-slow-mode-default-duration'
|
||||
const selector = '#peertube-livechat-slow-mode-duration'
|
||||
errorFieldSelectors.push(selector)
|
||||
await displayError(selector, await translate(LOC_INVALID_VALUE))
|
||||
}
|
||||
@ -233,7 +233,7 @@ async function vivifyConfigurationChannel (
|
||||
removeDisplayedErrors()
|
||||
const channelConfigurationOptions: ChannelConfigurationOptions = {
|
||||
slowMode: {
|
||||
defaultDuration: parseInt(data.get('slow_mode_default_duration')?.toString() ?? '0')
|
||||
duration: parseInt(data.get('slow_mode_duration')?.toString() ?? '0')
|
||||
},
|
||||
bot: {
|
||||
enabled: data.get('bot') === '1',
|
||||
|
Reference in New Issue
Block a user