🔨 Refactor: move guiApi to singleton

This commit is contained in:
PiEgg
2021-07-10 00:25:34 +08:00
parent 06b67e50b9
commit 8e5e9ec59a
3 changed files with 13 additions and 6 deletions

View File

@@ -130,8 +130,7 @@ class ShortKeyHandler {
} else if (command.includes('picgo-plugin-')) {
const handler = shortKeyService.getShortKeyHandler(command)
if (handler) {
const guiApi = new GuiApi()
return handler(picgo, guiApi)
return handler(picgo, GuiApi.getInstance())
}
} else {
logger.warn(`can not find command: ${command}`)