fix prod bug
This commit is contained in:
@@ -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}`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user