20 lines
522 B
TypeScript
20 lines
522 B
TypeScript
import { BrowserWindow, ipcMain, shell } from 'electron'
|
|
import Constants from './utils/Constants'
|
|
|
|
/*
|
|
* IPC Communications
|
|
* */
|
|
export default class IPCs {
|
|
static initialize(window: BrowserWindow): void {
|
|
// Get application version
|
|
ipcMain.on('msgRequestGetVersion', () => {
|
|
window.webContents.send('msgReceivedVersion', Constants.APP_VERSION)
|
|
})
|
|
|
|
// Open url via web browser
|
|
ipcMain.on('msgOpenExternalLink', async (event, url: string) => {
|
|
await shell.openExternal(url)
|
|
})
|
|
}
|
|
}
|