fix
This commit is contained in:
@@ -122,14 +122,29 @@ export class FrontblockAdmin extends ConfigLoader<AdminConf>{
|
||||
for(const api of rpcInfos){
|
||||
switch(api.info.type){
|
||||
case 'call':
|
||||
try{
|
||||
socket.unhook(api.name)
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
socket.hook(api.name, api.info.fn)
|
||||
break
|
||||
case 'hook':
|
||||
const hook = api.info.generator(socket)
|
||||
hook.bind(this)
|
||||
try{
|
||||
socket.unhook(api.name)
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
socket.hook(api.name, hook)
|
||||
break
|
||||
case 'unhook':
|
||||
try{
|
||||
socket.unhook(api.name)
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
socket.hook(api.name, api.info.fn)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -96,6 +96,6 @@ export default class PluginManagerPlugin extends PluginManager implements Plugin
|
||||
}
|
||||
|
||||
stop(): void {
|
||||
throw new Error("Method not implemented.");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,6 @@ export default class PluginManager extends ConfigLoader<PluginManagerConfig&Plug
|
||||
}
|
||||
|
||||
private async getLatestRelease(pluginName:string):Promise<any>{
|
||||
logger.info("Downloading Plugin", pluginName, "from", this.conf.resourceLocation + pluginName + '/releases')
|
||||
if(pluginName === this.name) pluginName = "admin"
|
||||
const response = await fetch(this.conf.resourceLocation + pluginName + '/releases')
|
||||
if (!response.ok) throw new Error(pluginName+": "+response.statusText)
|
||||
|
||||
Reference in New Issue
Block a user