mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 11:42:10 +00:00
messing around and testing
This commit is contained in:
parent
cdad2f5554
commit
10943408e9
3 changed files with 55 additions and 3 deletions
|
@ -63,11 +63,18 @@ app.whenReady().then(() => {
|
||||||
where: { id: 1 },
|
where: { id: 1 },
|
||||||
});
|
});
|
||||||
|
|
||||||
WindowManager.createMainWindow();
|
WindowManager.createSplashScreen();
|
||||||
|
|
||||||
WindowManager.createSystemTray(userPreferences?.language || "en");
|
WindowManager.createSystemTray(userPreferences?.language || "en");
|
||||||
|
|
||||||
WindowManager.mainWindow?.on("ready-to-show", () => {
|
WindowManager.splashWindow?.on("ready-to-show", () => {
|
||||||
autoUpdater.checkForUpdatesAndNotify();
|
console.log("ready to show");
|
||||||
|
autoUpdater.checkForUpdates().then((r) => {
|
||||||
|
console.log(r);
|
||||||
|
|
||||||
|
WindowManager.splashWindow?.close();
|
||||||
|
WindowManager.createMainWindow();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,6 +17,7 @@ import { IsNull, Not } from "typeorm";
|
||||||
|
|
||||||
export class WindowManager {
|
export class WindowManager {
|
||||||
public static mainWindow: Electron.BrowserWindow | null = null;
|
public static mainWindow: Electron.BrowserWindow | null = null;
|
||||||
|
public static splashWindow: Electron.BrowserWindow | null = null;
|
||||||
|
|
||||||
private static loadURL(hash = "") {
|
private static loadURL(hash = "") {
|
||||||
// HMR for renderer base on electron-vite cli.
|
// HMR for renderer base on electron-vite cli.
|
||||||
|
@ -35,6 +36,49 @@ export class WindowManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static loadSplashURL() {
|
||||||
|
// HMR for renderer base on electron-vite cli.
|
||||||
|
// Load the remote URL for development or the local html file for production.
|
||||||
|
if (is.dev && process.env["ELECTRON_RENDERER_URL"]) {
|
||||||
|
this.splashWindow?.loadURL(
|
||||||
|
`${process.env["ELECTRON_RENDERER_URL"]}#/splash`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.splashWindow?.loadFile(
|
||||||
|
path.join(__dirname, "../renderer/index.html"),
|
||||||
|
{
|
||||||
|
hash: "splash",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static createSplashScreen() {
|
||||||
|
this.splashWindow = new BrowserWindow({
|
||||||
|
width: 810,
|
||||||
|
height: 610,
|
||||||
|
minWidth: 810,
|
||||||
|
minHeight: 610,
|
||||||
|
titleBarStyle: "hidden",
|
||||||
|
...(process.platform === "linux" ? { icon } : {}),
|
||||||
|
transparent: true,
|
||||||
|
frame: false,
|
||||||
|
alwaysOnTop: true,
|
||||||
|
trafficLightPosition: { x: 16, y: 16 },
|
||||||
|
titleBarOverlay: {
|
||||||
|
symbolColor: "#DADBE1",
|
||||||
|
color: "#151515",
|
||||||
|
height: 34,
|
||||||
|
},
|
||||||
|
webPreferences: {
|
||||||
|
preload: path.join(__dirname, "../preload/index.mjs"),
|
||||||
|
sandbox: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
this.loadSplashURL();
|
||||||
|
}
|
||||||
|
|
||||||
public static createMainWindow() {
|
public static createMainWindow() {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
this.mainWindow = new BrowserWindow({
|
this.mainWindow = new BrowserWindow({
|
||||||
|
|
|
@ -54,6 +54,7 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||||
<Route path="/game/:shop/:objectID" Component={GameDetails} />
|
<Route path="/game/:shop/:objectID" Component={GameDetails} />
|
||||||
<Route path="/search" Component={SearchResults} />
|
<Route path="/search" Component={SearchResults} />
|
||||||
<Route path="/settings" Component={Settings} />
|
<Route path="/settings" Component={Settings} />
|
||||||
|
<Route path="/splash" Component={Settings} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</App>
|
</App>
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
|
|
Loading…
Reference in a new issue