Don't show more than a single about window

This commit is contained in:
Amelia Frost 2026-04-05 23:14:39 -07:00
parent 4f845f58a9
commit a632ecde33
No known key found for this signature in database
2 changed files with 8 additions and 5 deletions

View file

@ -9,6 +9,12 @@ export let aboutWindow: BrowserWindow;
// Create our about window
export function createAboutWindow() {
// If our about window already exists, show it
if (aboutWindow) {
aboutWindow.show();
return;
}
aboutWindow = new BrowserWindow({
minWidth: 300,
minHeight: 300,
@ -30,6 +36,7 @@ export function createAboutWindow() {
},
});
// Remove the default menu
aboutWindow.setMenu(null);
aboutWindow.loadFile(join(__dirname, "about.html"));

View file

@ -148,11 +148,7 @@ export function createMainWindow() {
mainWindow.webContents.setZoomLevel(0);
} else if (input.key === "F1") {
event.preventDefault();
if (!aboutWindow) {
createAboutWindow();
} else {
aboutWindow.show();
}
createAboutWindow();
} else if (
input.key === "F5" ||
((input.control || input.meta) && input.key.toLowerCase() === "r")