Skip to content

Commit

Permalink
feat: #319 PicGO图形化配置界面-优化事件监听
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Feb 14, 2023
1 parent 9b3bb69 commit 65837fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/picgo/setting/PicgoPluginSetting.vue
Expand Up @@ -52,7 +52,7 @@ function goAwesomeList() {
}
function handleImportLocalPlugin() {
picgoUtil.ipcHandleImportLocalPlugin()
picgoUtil.ipcHandleEvent("importLocalPlugin")
}
</script>

Expand Down
12 changes: 9 additions & 3 deletions utils/otherlib/picgoUtil.js
Expand Up @@ -414,11 +414,17 @@ const getPicgoCfgFile = (filename) => {
return syPicgo.combinePath(picgo.baseDir, filename)
}

const ipcHandleImportLocalPlugin = () => {
/**
* 统一发送消息的入口
*
* @param channel 频道
* @param args 参数
*/
const ipcHandleEvent = (channel, args = {}) => {
const syWin = siyuanBrowserUtil.getSiyuanWindow()
const syPicgo = syWin?.SyPicgo

syPicgo.ipcMethods.handleImportLocalPlugin()
syPicgo.ipcMethods.handleEvent(channel, args)
}

/**
Expand Down Expand Up @@ -451,6 +457,6 @@ const picgoUtil = {
getPicgoCfgFile,

// Ipc
ipcHandleImportLocalPlugin,
ipcHandleEvent,
}
export default picgoUtil

0 comments on commit 65837fb

Please sign in to comment.