Skip to content

Commit

Permalink
fix loading the app when packaged
Browse files Browse the repository at this point in the history
  • Loading branch information
bcdrme committed Jan 3, 2025
1 parent 7dca6be commit 41955aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<body>
<div id="app"></div>
<script src="/src/renderer/index.ts" type="module"></script>
</body>

<script src="./src/renderer/index.ts" type="module"></script>
</html>
6 changes: 3 additions & 3 deletions src/main/main-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ export function createWindow() {
});

// and load the index.html of the app.
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
} else {
if (app.isPackaged) {
mainWindow.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`));
} else {
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
}

mainWindow.on("restore", () => mainWindow.flashFrame(false));
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ app.whenReady().then(() => {
callback({
responseHeaders: {
...details.responseHeaders,
"Content-Security-Policy": ["default-src 'self' 'unsafe-inline' blob:"],
"Content-Security-Policy": ["default-src 'self' 'unsafe-inline' blob: data:"],
},
});
});
Expand Down

0 comments on commit 41955aa

Please sign in to comment.