2021-06-02 19:54:04 +02:00
|
|
|
import type { ChatType } from 'shared/lib/types'
|
2021-05-10 21:04:04 +02:00
|
|
|
|
|
|
|
function register ({ registerSettingsScript }: RegisterOptions): void {
|
2021-06-02 12:32:00 +02:00
|
|
|
registerSettingsScript({
|
|
|
|
isSettingHidden: options => {
|
|
|
|
const name = options.setting.name
|
2021-06-02 19:54:04 +02:00
|
|
|
switch (name) {
|
|
|
|
case 'chat-type-help-disabled':
|
|
|
|
return options.formValues['chat-type'] !== ('disabled' as ChatType)
|
2021-06-03 11:46:11 +02:00
|
|
|
case 'prosody-port':
|
2021-06-02 19:54:04 +02:00
|
|
|
case 'chat-type-help-builtin-prosody':
|
|
|
|
return options.formValues['chat-type'] !== ('builtin-prosody' as ChatType)
|
2021-06-03 11:46:11 +02:00
|
|
|
case 'chat-server':
|
|
|
|
case 'chat-room':
|
|
|
|
case 'chat-bosh-uri':
|
|
|
|
case 'chat-ws-uri':
|
2021-06-02 19:54:04 +02:00
|
|
|
case 'chat-type-help-builtin-converse':
|
|
|
|
return options.formValues['chat-type'] !== ('builtin-converse' as ChatType)
|
2021-06-03 11:46:11 +02:00
|
|
|
case 'chat-uri':
|
2021-06-02 19:54:04 +02:00
|
|
|
case 'chat-type-help-external-uri':
|
|
|
|
return options.formValues['chat-type'] !== ('external-uri' as ChatType)
|
2021-06-03 11:46:11 +02:00
|
|
|
case 'chat-style':
|
|
|
|
return options.formValues['chat-type'] === 'disabled'
|
2021-06-03 12:20:19 +02:00
|
|
|
case 'chat-only-locals-warning':
|
|
|
|
return options.formValues['chat-only-locals'] === true
|
2021-06-08 18:08:58 +02:00
|
|
|
case 'chat-per-live-video-warning':
|
|
|
|
return !(options.formValues['chat-all-lives'] === true && options.formValues['chat-per-live-video'] === true)
|
2021-06-02 19:54:04 +02:00
|
|
|
}
|
|
|
|
|
2021-06-02 12:32:00 +02:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
})
|
2021-05-10 21:04:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
|
|
|
register
|
|
|
|
}
|