From 5b62163c4e5875e659ea83cc766f1984a56444bb Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Sun, 8 Jun 2025 14:44:54 -0500 Subject: [PATCH] Load files when in args --- newton/app.js | 3 ++- newton/preload.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/newton/app.js b/newton/app.js index be91a15..5053fa4 100644 --- a/newton/app.js +++ b/newton/app.js @@ -40,7 +40,8 @@ const createWindow = (startType = "build", debug = false, args = []) => { }); win.once('ready-to-show', () => { - win.show() + win.show(); + win.webContents.send('load-files', args); }); menu.load(win); diff --git a/newton/preload.js b/newton/preload.js index 07d5def..cce0ff4 100644 --- a/newton/preload.js +++ b/newton/preload.js @@ -6,6 +6,7 @@ contextBridge.exposeInMainWorld('electron', { chrome: () => process.versions.chrome, electron: () => process.versions.electron, }); + contextBridge.exposeInMainWorld('main', { onMenuActions: (callback) => ipcRenderer.on('menu-actions', (_event, action) => callback(action)), });