mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-31 13:11:20 +08:00
27 lines
543 B
TypeScript
27 lines
543 B
TypeScript
import { BrowserWindow, ipcMain, shell } from 'electron'
|
|
|
|
export default function initPublicIpc() {
|
|
ipcMain.on(
|
|
'update-window-size',
|
|
(
|
|
ev,
|
|
size: {
|
|
width: number
|
|
height: number
|
|
animate?: boolean
|
|
}
|
|
) => {
|
|
const win = BrowserWindow.fromWebContents(ev.sender)
|
|
if (!win) {
|
|
return
|
|
}
|
|
win.setSize(size.width, size.height, size.animate)
|
|
}
|
|
)
|
|
ipcMain.on('open-external-link', (_, link) => {
|
|
shell.openExternal(link, {
|
|
activate: true
|
|
})
|
|
})
|
|
}
|