From 8747b875f193eb31dd57b402d9699222ff291d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Gediz=20Ayd=C4=B1ndo=C4=9Fmu=C5=9F?= Date: Wed, 15 Feb 2023 00:24:01 +0300 Subject: [PATCH] Update main.js Add an IPC handler --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index ce72f1f..f59505a 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,5 @@ // Importing modules -const { app, BrowserWindow } = require('electron') +const { app, BrowserWindow, ipcMain } = require('electron') const path = require('path') // Reusable function to instantiate windows @@ -11,7 +11,7 @@ const createWindow = () => { preload: path.join(__dirname, 'preload.js'), } }) - + ipcMain.handle('ping', () => 'pong') win.loadFile('index.html') }