Remove backward compatibility (registerSettingsScript).
This commit is contained in:
parent
a1d5d83cc5
commit
56f1c5895e
3
client/@types/peertube.d.ts
vendored
3
client/@types/peertube.d.ts
vendored
@ -47,8 +47,7 @@ interface RegisterClientSettingsScript {
|
||||
interface RegisterOptions {
|
||||
registerHook: (options: RegisterClientHookOptions) => void
|
||||
peertubeHelpers: RegisterClientHelpers
|
||||
// registerSettingsScript comes with Peertube 3.2.0.
|
||||
registerSettingsScript?: (options: RegisterClientSettingsScript) => void
|
||||
registerSettingsScript: (options: RegisterClientSettingsScript) => void
|
||||
}
|
||||
|
||||
interface Video {
|
||||
|
@ -3,29 +3,27 @@ const converseSettings = ['chat-server', 'chat-room', 'chat-bosh-uri', 'chat-ws-
|
||||
const otherSettings: string[] = []
|
||||
|
||||
function register ({ registerSettingsScript }: RegisterOptions): void {
|
||||
if (registerSettingsScript) {
|
||||
registerSettingsScript({
|
||||
isSettingHidden: options => {
|
||||
const name = options.setting.name
|
||||
if (prosodySettings.includes(name)) {
|
||||
return options.formValues['chat-use-prosody'] !== true
|
||||
}
|
||||
if (name === 'chat-use-builtin') {
|
||||
return options.formValues['chat-use-prosody'] === true
|
||||
}
|
||||
if (converseSettings.includes(name)) {
|
||||
return options.formValues['chat-use-builtin'] !== true || options.formValues['chat-use-prosody'] === true
|
||||
}
|
||||
if (name === 'chat-uri') {
|
||||
return options.formValues['chat-use-prosody'] === true || options.formValues['chat-use-builtin'] === true
|
||||
}
|
||||
if (otherSettings.includes(name)) {
|
||||
return options.formValues['chat-use-builtin'] === true || options.formValues['chat-use-prosody'] === true
|
||||
}
|
||||
return false
|
||||
registerSettingsScript({
|
||||
isSettingHidden: options => {
|
||||
const name = options.setting.name
|
||||
if (prosodySettings.includes(name)) {
|
||||
return options.formValues['chat-use-prosody'] !== true
|
||||
}
|
||||
})
|
||||
}
|
||||
if (name === 'chat-use-builtin') {
|
||||
return options.formValues['chat-use-prosody'] === true
|
||||
}
|
||||
if (converseSettings.includes(name)) {
|
||||
return options.formValues['chat-use-builtin'] !== true || options.formValues['chat-use-prosody'] === true
|
||||
}
|
||||
if (name === 'chat-uri') {
|
||||
return options.formValues['chat-use-prosody'] === true || options.formValues['chat-use-builtin'] === true
|
||||
}
|
||||
if (otherSettings.includes(name)) {
|
||||
return options.formValues['chat-use-builtin'] === true || options.formValues['chat-use-prosody'] === true
|
||||
}
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
|
Loading…
x
Reference in New Issue
Block a user