diff --git a/package.json b/package.json index 6cb748ac..b82ae700 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydra", - "version": "1.2.2", + "version": "1.2.1", "description": "Hydra", "main": "./out/main/index.js", "author": "Los Broxas", @@ -50,6 +50,7 @@ "color.js": "^1.2.0", "date-fns": "^3.6.0", "easydl": "^1.1.1", + "electron-log": "^5.1.4", "electron-updater": "^6.1.8", "fetch-cookie": "^3.0.1", "flexsearch": "^0.7.43", diff --git a/src/main/index.ts b/src/main/index.ts index 445164b5..7b6af0df 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -7,7 +7,7 @@ import { resolveDatabaseUpdates, WindowManager } from "@main/services"; import { dataSource } from "@main/data-source"; import * as resources from "@locales"; import { userPreferencesRepository } from "@main/repository"; - +import electronLog from "electron-log"; const { autoUpdater } = updater; autoUpdater.setFeedURL({ @@ -16,6 +16,9 @@ autoUpdater.setFeedURL({ repo: "hydra", }); +autoUpdater.logger = electronLog; +autoUpdater.logger.transports.file.level = "info"; + const gotTheLock = app.requestSingleInstanceLock(); if (!gotTheLock) app.quit(); @@ -72,8 +75,8 @@ app.whenReady().then(() => { autoUpdater.checkForUpdates().then((r) => { console.log(r); - WindowManager.splashWindow?.close(); - WindowManager.createMainWindow(); + //WindowManager.splashWindow?.close(); + //WindowManager.createMainWindow(); }); }); }); diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index 6d808e46..f1e56256 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -41,42 +41,25 @@ export class WindowManager { // 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` + `${process.env["ELECTRON_RENDERER_URL"]}/splash.html` ); } else { this.splashWindow?.loadFile( - path.join(__dirname, "../renderer/index.html"), - { - hash: "splash", - } + path.join(__dirname, "../renderer/splash.html") ); } } 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, - }, + width: 400, + height: 400, + frame: true, + alwaysOnTop: false, }); this.loadSplashURL(); + this.splashWindow.removeMenu(); } public static createMainWindow() { diff --git a/src/renderer/splash.html b/src/renderer/splash.html new file mode 100644 index 00000000..bb0b5553 --- /dev/null +++ b/src/renderer/splash.html @@ -0,0 +1,16 @@ + + + + + + Hydra + + + +
+ + + diff --git a/src/renderer/src/assets/icon.png b/src/renderer/src/assets/icon.png new file mode 100644 index 00000000..865a96a2 Binary files /dev/null and b/src/renderer/src/assets/icon.png differ diff --git a/src/renderer/src/main.tsx b/src/renderer/src/main.tsx index 2098feb3..f44653cb 100644 --- a/src/renderer/src/main.tsx +++ b/src/renderer/src/main.tsx @@ -54,7 +54,6 @@ ReactDOM.createRoot(document.getElementById("root")!).render( - diff --git a/src/renderer/src/pages/splash/splash.css.ts b/src/renderer/src/pages/splash/splash.css.ts new file mode 100644 index 00000000..794a6057 --- /dev/null +++ b/src/renderer/src/pages/splash/splash.css.ts @@ -0,0 +1,18 @@ +import { style } from "@vanilla-extract/css"; +import { SPACING_UNIT, vars } from "../../theme.css"; + +export const main = style({ + width: "100%", + height: "100%", + display: "flex", + flexDirection: "column", + gap: `${SPACING_UNIT * 3}px`, + padding: `${SPACING_UNIT * 3}px`, + flex: "1", + overflowY: "auto", + alignItems: "center", +}); + +export const splashIcon = style({ + width: "300px", +}); diff --git a/src/renderer/src/pages/splash/splash.tsx b/src/renderer/src/pages/splash/splash.tsx new file mode 100644 index 00000000..f4fe8ae9 --- /dev/null +++ b/src/renderer/src/pages/splash/splash.tsx @@ -0,0 +1,16 @@ +import icon from "@renderer/assets/icon.png"; +import * as styles from "./splash.css"; +import { themeClass } from "../../theme.css"; + +import "../../app.css"; + +document.body.classList.add(themeClass); + +export default function Splash() { + return ( +
+ +

Procurando atualizaƧoes

+
+ ); +} diff --git a/src/renderer/src/splash.tsx b/src/renderer/src/splash.tsx new file mode 100644 index 00000000..976f04fc --- /dev/null +++ b/src/renderer/src/splash.tsx @@ -0,0 +1,9 @@ +import React from "react"; +import ReactDOM from "react-dom/client"; +import Splash from "./pages/splash/splash"; + +ReactDOM.createRoot(document.getElementById("root")!).render( + + + +); diff --git a/yarn.lock b/yarn.lock index 76e0d8ce..84ee99e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2707,6 +2707,11 @@ electron-builder@^24.9.1: simple-update-notifier "2.0.0" yargs "^17.6.2" +electron-log@^5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-5.1.4.tgz#9b7ea4ae1167475f3c9babc5c3d94d54f46dd35a" + integrity sha512-P0RSXnwT3z+e89Z5uAcZDeN85/QjIgv764a93kqCi+wh2Jm22CCbc3AGDt4S8rsxAHWHB4Q0PGsQl3fw1AN0kQ== + electron-publish@24.13.1: version "24.13.1" resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-24.13.1.tgz#57289b2f7af18737dc2ad134668cdd4a1b574a0c"