From 106d39110f70776fee6916ff9e302b9130ca56fc Mon Sep 17 00:00:00 2001 From: RobertGemmaJr Date: Thu, 29 Feb 2024 16:12:36 -0500 Subject: [PATCH] fix: Fix index.html file to be the one in the build folder --- public/electron/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/electron/main.js b/public/electron/main.js index 798717212..25ed87159 100644 --- a/public/electron/main.js +++ b/public/electron/main.js @@ -20,6 +20,7 @@ log.initialize({ preload: true }); // TODO @brown-ccv #192: Handle data writing to desktop in a utility process? // TODO @brown-ccv #192: Handle video data writing to desktop in a utility process? // TODO @brown-ccv #398: Separate log files for each run through? +// TODO @brown-ccv: Use app.getPath('temp') for temporary JSON file /************ GLOBALS ***********/ @@ -268,6 +269,9 @@ function createWindow() { let mainWindow; let appURL; + console.log(__dirname); + console.log(path.join(__dirname, "index.html")); + if (process.env.ELECTRON_START_URL) { // Running in development @@ -289,7 +293,10 @@ function createWindow() { // Load app from the local bundle created by the build process appURL = url.format({ - pathname: path.join(__dirname, "index.html"), + // Moves from path of the electron file (/public/electron/main.js) to build folder (build/index.html) + // TODO @brown-ccv: This means we're using the non-built Electron file? + // TODO @brown-ccv: electron-forge should only be packaging the build folder (package.json needs to point to that file?) + pathname: path.join(__dirname, "../../build/index.html"), protocol: "file:", slashes: true, });