Skip to content

Commit 76a3deb

Browse files
committed
fixed the desktop app so that it can open properly in production
1 parent acf3322 commit 76a3deb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

electron/Main.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import './routes/dashboard';
33
import { clearGuestSettings } from './routes/dashboard';
44
import './routes/data';
55
import './routes/cloudbased';
6-
import path from 'path';
6+
import { join } from 'path';
77

88
// Declare variable to be used as the application window
99
let win: Electron.BrowserWindow;
@@ -22,7 +22,6 @@ const createWindow = () => {
2222
nodeIntegration: true,
2323
contextIsolation: false,
2424
},
25-
2625
});
2726

2827
if (process.env.NODE_ENV === 'development') {
@@ -33,7 +32,11 @@ const createWindow = () => {
3332
win.webContents.openDevTools();
3433
} else {
3534
// Production
36-
win.loadFile(path.resolve(__dirname, '../index.html'));
35+
// win.loadFile(path.resolve(__dirname, '../index.html'));
36+
//* Wasn't going to the correct file in the line above.
37+
const indexPath = join(app.getAppPath(), 'index.html');
38+
console.log('indexPath: ', indexPath); //* I can't get this to console log. I would love to see what this path is to better understand the build!
39+
win.loadFile(indexPath);
3740
}
3841

3942
ipcMain.on('max', () => {

0 commit comments

Comments
 (0)