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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user