return undefined
}
- onSettingsChanged (name: string, settings: any) {
+ async onSettingsChanged (name: string, settings: any) {
const registered = this.getRegisteredPluginByShortName(name)
if (!registered) {
logger.error('Cannot find plugin %s to call on settings changed.', name)
for (const cb of registered.registerHelpers.getOnSettingsChangedCallbacks()) {
try {
- cb(settings)
+ await cb(settings)
} catch (err) {
logger.error('Cannot run on settings changed callback for %s.', registered.npmName, { err })
}
private idAndPassAuths: RegisterServerAuthPassOptions[] = []
private externalAuths: RegisterServerAuthExternalOptions[] = []
- private readonly onSettingsChangeCallbacks: ((settings: any) => void)[] = []
+ private readonly onSettingsChangeCallbacks: ((settings: any) => Promise<any>)[] = []
private readonly router: express.Router
setSetting: (name: string, value: string) => PluginModel.setSetting(this.plugin.name, this.plugin.type, name, value),
- onSettingsChange: (cb: (settings: any) => void) => this.onSettingsChangeCallbacks.push(cb)
+ onSettingsChange: (cb: (settings: any) => Promise<any>) => this.onSettingsChangeCallbacks.push(cb)
}
}