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 {
|
interface RegisterOptions {
|
||||||
registerHook: (options: RegisterClientHookOptions) => void
|
registerHook: (options: RegisterClientHookOptions) => void
|
||||||
peertubeHelpers: RegisterClientHelpers
|
peertubeHelpers: RegisterClientHelpers
|
||||||
// registerSettingsScript comes with Peertube 3.2.0.
|
registerSettingsScript: (options: RegisterClientSettingsScript) => void
|
||||||
registerSettingsScript?: (options: RegisterClientSettingsScript) => void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Video {
|
interface Video {
|
||||||
|
@ -3,29 +3,27 @@ const converseSettings = ['chat-server', 'chat-room', 'chat-bosh-uri', 'chat-ws-
|
|||||||
const otherSettings: string[] = []
|
const otherSettings: string[] = []
|
||||||
|
|
||||||
function register ({ registerSettingsScript }: RegisterOptions): void {
|
function register ({ registerSettingsScript }: RegisterOptions): void {
|
||||||
if (registerSettingsScript) {
|
registerSettingsScript({
|
||||||
registerSettingsScript({
|
isSettingHidden: options => {
|
||||||
isSettingHidden: options => {
|
const name = options.setting.name
|
||||||
const name = options.setting.name
|
if (prosodySettings.includes(name)) {
|
||||||
if (prosodySettings.includes(name)) {
|
return options.formValues['chat-use-prosody'] !== true
|
||||||
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
|
|
||||||
}
|
}
|
||||||
})
|
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 {
|
export {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user