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