Fix broken plugin state
This commit is contained in:
parent
e63eede42f
commit
dffbf8b577
@ -125,7 +125,12 @@ async function register ({
|
|||||||
if (settings['auth-display-name']) store.authDisplayName = settings['auth-display-name']
|
if (settings['auth-display-name']) store.authDisplayName = settings['auth-display-name']
|
||||||
})
|
})
|
||||||
|
|
||||||
await loadSettingsAndCreateClient(registerExternalAuth, unregisterExternalAuth, peertubeHelpers, settingsManager)
|
try {
|
||||||
|
await loadSettingsAndCreateClient(registerExternalAuth, unregisterExternalAuth, peertubeHelpers, settingsManager)
|
||||||
|
} catch (err) {
|
||||||
|
logger.error('Cannot load settings and create open id client.', { err })
|
||||||
|
}
|
||||||
|
|
||||||
store.authDisplayName = await settingsManager.getSetting('auth-display-name')
|
store.authDisplayName = await settingsManager.getSetting('auth-display-name')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,10 +26,26 @@ function register ({ registerHook, registerVideoField }) {
|
|||||||
type: 'input-checkbox'
|
type: 'input-checkbox'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const commonOptions4 = {
|
||||||
|
name: 'hello-world-field-4',
|
||||||
|
label: 'Super field 4 in main tab',
|
||||||
|
type: 'input-checkbox',
|
||||||
|
hidden: ({ formValues }) => {
|
||||||
|
return formValues['privacy'] !== 1 && formValues['privacy'] !== 2
|
||||||
|
},
|
||||||
|
error: ({ formValues, value }) => {
|
||||||
|
if (formValues['privacy'] !== 1 && formValues['privacy'] !== 2) return { error: false }
|
||||||
|
if (value === true) return { error: false }
|
||||||
|
|
||||||
|
return { error: true, text: 'Should be enabled' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const type of [ 'upload', 'import-url', 'update' ]) {
|
for (const type of [ 'upload', 'import-url', 'update' ]) {
|
||||||
registerVideoField(commonOptions1, { type })
|
registerVideoField(commonOptions1, { type })
|
||||||
registerVideoField(commonOptions2, { type })
|
registerVideoField(commonOptions2, { type })
|
||||||
registerVideoField(commonOptions3, { type })
|
registerVideoField(commonOptions3, { type })
|
||||||
|
registerVideoField(commonOptions4, { type, tab: 'main' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user