feat: 隐藏窗口自带应用菜单栏,清理相关死代码
This commit is contained in:
@@ -15,15 +15,7 @@ const api = {
|
||||
showInFolder: (filePath: string): Promise<boolean> =>
|
||||
ipcRenderer.invoke('file:show-in-folder', filePath),
|
||||
setClipboard: (text: string): Promise<boolean> =>
|
||||
ipcRenderer.invoke('clipboard:write', text),
|
||||
/** 订阅顶部菜单命令,返回取消订阅函数 */
|
||||
onMenuCommand: (callback: (cmd: string) => void): (() => void) => {
|
||||
const listener = (_e: unknown, cmd: string): void => callback(cmd)
|
||||
ipcRenderer.on('menu:command', listener)
|
||||
return () => {
|
||||
ipcRenderer.removeListener('menu:command', listener)
|
||||
}
|
||||
}
|
||||
ipcRenderer.invoke('clipboard:write', text)
|
||||
}
|
||||
|
||||
export type DiffLensApi = typeof api
|
||||
|
||||
Reference in New Issue
Block a user