fix prod bug
Some checks are pending
Build Electron App / build (macos-latest, build:mac) (push) Waiting to run
Build Electron App / build (ubuntu-latest, build:linux) (push) Waiting to run
Build Electron App / build (windows-latest, build:win) (push) Waiting to run

This commit is contained in:
nicwands
2026-03-03 20:58:31 -05:00
parent 73349444d6
commit e48779e8e0
5 changed files with 34 additions and 30 deletions

View File

@@ -273,7 +273,7 @@ class NotesAPI {
const preloadPath = join(__dirname, "../preload/index.mjs");
const rendererPath = join(__dirname, "../renderer/index.html");
function createWindow() {
const mainWindow2 = new BrowserWindow({
const mainWindow = new BrowserWindow({
width: 354,
height: 549,
show: false,
@@ -283,17 +283,17 @@ function createWindow() {
sandbox: false
}
});
mainWindow2.on("ready-to-show", () => {
mainWindow2.show();
mainWindow.on("ready-to-show", () => {
mainWindow.show();
});
mainWindow2.webContents.setWindowOpenHandler((details) => {
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url);
return { action: "deny" };
});
if (is.dev && process.env["ELECTRON_RENDERER_URL"]) {
mainWindow2.loadURL(process.env["ELECTRON_RENDERER_URL"]);
mainWindow.loadURL(process.env["ELECTRON_RENDERER_URL"]);
} else {
mainWindow2.loadFile(rendererPath);
mainWindow.loadFile(rendererPath);
}
}
function createNoteWindow(noteId) {
@@ -310,11 +310,11 @@ function createNoteWindow(noteId) {
});
if (is.dev && process.env["ELECTRON_RENDERER_URL"]) {
noteWindow.loadURL(
`${process.env["ELECTRON_RENDERER_URL"]}/note/${noteId}`
`${process.env["ELECTRON_RENDERER_URL"]}/#/note/${noteId}`
);
} else {
mainWindow.loadFile(rendererPath, {
path: `/notes/${noteId}`
noteWindow.loadFile(rendererPath, {
hash: `/note/${noteId}`
});
}
}

View File

@@ -9253,6 +9253,11 @@ function createWebHistory(base2) {
});
return routerHistory;
}
function createWebHashHistory(base2) {
base2 = location.host ? base2 || location.pathname + location.search : "";
if (!base2.includes("#")) base2 += "#";
return createWebHistory(base2);
}
let TokenType = /* @__PURE__ */ (function(TokenType2) {
TokenType2[TokenType2["Static"] = 0] = "Static";
TokenType2[TokenType2["Param"] = 1] = "Param";
@@ -10704,7 +10709,6 @@ const _sfc_main$9 = {
createBaseVNode("div", _hoisted_1$8, [
createVNode(_sfc_main$b, {
class: "menu-item",
category: "Special Delivery",
onNoteOpened: unref(closeMenu)
}, null, 8, ["onNoteOpened"]),
createVNode(_component_router_link, {
@@ -87785,7 +87789,7 @@ const routes = [
{ path: "/instructions", name: "instructions", component: Instructions }
];
const router = createRouter({
history: createWebHistory(),
history: createWebHashHistory(),
routes
});
const app = createApp(_sfc_main$7);

View File

@@ -1,18 +1,18 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Electron</title>
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
/>
<script type="module" crossorigin src="./assets/index-GKstRZpo.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-D9ZUihqb.css">
</head>
<head>
<meta charset="UTF-8" />
<title>Electron</title>
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"
/>
<script type="module" crossorigin src="./assets/index-DdUrngdf.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-D9ZUihqb.css">
</head>
<body>
<div id="app"></div>
</body>
<body>
<div id="app"></div>
</body>
</html>