mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-26 20:31:03 +00:00
feat: Hide to tray on game startup and ability to disable trailers auto-play
This commit is contained in:
@@ -4,7 +4,8 @@ import type { Game, GameRunning } from "@types";
|
||||
import { PythonRPC } from "./python-rpc";
|
||||
import axios from "axios";
|
||||
import { ProcessPayload } from "./download/types";
|
||||
import { gamesSublevel, levelKeys } from "@main/level";
|
||||
import { db, gamesSublevel, levelKeys } from "@main/level";
|
||||
import type { UserPreferences } from "@types";
|
||||
import { CloudSync } from "./cloud-sync";
|
||||
import { logger } from "./logger";
|
||||
import path from "path";
|
||||
@@ -209,6 +210,18 @@ function onOpenGame(game: Game) {
|
||||
lastSyncTick: now,
|
||||
});
|
||||
|
||||
// Hide Hydra to tray on game startup if enabled
|
||||
db
|
||||
.get<string, UserPreferences | null>(levelKeys.userPreferences, {
|
||||
valueEncoding: "json",
|
||||
})
|
||||
.then((userPreferences) => {
|
||||
if (userPreferences?.hideToTrayOnGameStart) {
|
||||
WindowManager.mainWindow?.hide();
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
if (game.remoteId) {
|
||||
updateGamePlaytime(
|
||||
game,
|
||||
|
||||
Reference in New Issue
Block a user