fix: handle loadURL() failures correctly (#1093)

This commit is contained in:
Cookie
2025-04-22 16:03:17 -04:00
committed by GitHub
parent c7d830c57c
commit 3936a0a41e
5 changed files with 70 additions and 5 deletions

View File

@@ -11,11 +11,16 @@ import { ICON_PATH, VIEW_DIR } from "shared/paths";
import { Settings } from "./settings";
let splash: BrowserWindow | undefined;
export function createSplashWindow(startMinimized = false) {
const splash = new BrowserWindow({
splash = new BrowserWindow({
...SplashProps,
icon: ICON_PATH,
show: !startMinimized
show: !startMinimized,
webPreferences: {
preload: join(__dirname, "splashPreload.js")
}
});
splash.loadFile(join(VIEW_DIR, "splash.html"));
@@ -37,3 +42,7 @@ export function createSplashWindow(startMinimized = false) {
return splash;
}
export function updateSplashMessage(message: string) {
if (splash && !splash.isDestroyed()) splash.webContents.send("update-splash-message", message);
}