mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Some plugins fixes and doc enhancements
This commit is contained in:
parent
662e5d4fe4
commit
9fa6ca160a
6 changed files with 45 additions and 19 deletions
|
@ -104,10 +104,12 @@ export class PluginManager {
|
|||
|
||||
for (const hook of this.hooks[hookName]) {
|
||||
try {
|
||||
const p = hook.handler(param)
|
||||
|
||||
if (wait) {
|
||||
result = await hook.handler(param)
|
||||
} else {
|
||||
result = hook.handler()
|
||||
result = await p
|
||||
} else if (p.catch) {
|
||||
p.catch(err => logger.warn('Hook %s of plugin %s thrown an error.', hookName, hook.pluginName, { err }))
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error('Cannot run hook %s of plugin %s.', hookName, hook.pluginName, { err })
|
||||
|
@ -329,7 +331,7 @@ export class PluginManager {
|
|||
registerSetting,
|
||||
settingsManager,
|
||||
storageManager
|
||||
})
|
||||
}).catch(err => logger.error('Cannot register plugin %s.', npmName, { err }))
|
||||
|
||||
logger.info('Add plugin %s CSS to global file.', npmName)
|
||||
|
||||
|
@ -365,7 +367,7 @@ export class PluginManager {
|
|||
private async regeneratePluginGlobalCSS () {
|
||||
await this.resetCSSGlobalFile()
|
||||
|
||||
for (const key of Object.keys(this.registeredPlugins)) {
|
||||
for (const key of Object.keys(this.getRegisteredPlugins())) {
|
||||
const plugin = this.registeredPlugins[key]
|
||||
|
||||
await this.addCSSToGlobalFile(plugin.path, plugin.css)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue