mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
ci: testing pipeline
This commit is contained in:
parent
05177d5e9c
commit
25fb4342d6
27 changed files with 1349 additions and 1399 deletions
|
@ -9,9 +9,8 @@
|
|||
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://steamcdn-a.akamaihd.net https://cdn.cloudflare.steamstatic.com https://cdn2.steamgriddb.com https://cdn.akamai.steamstatic.com;"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<body style="background-color: #1c1c1">
|
||||
<div id="root"></div>
|
||||
<h1>hello</h1>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -22,7 +22,7 @@ export function BottomPanel() {
|
|||
}, []);
|
||||
|
||||
const status = useMemo(() => {
|
||||
if (isDownloading) {
|
||||
if (isDownloading && game) {
|
||||
if (game.status === "downloading_metadata")
|
||||
return t("downloading_metadata", { title: game.title });
|
||||
|
||||
|
|
|
@ -62,12 +62,14 @@ export function Modal({
|
|||
const onMouseDown = (e: MouseEvent) => {
|
||||
if (!isTopMostModal()) return;
|
||||
|
||||
const clickedOutsideContent = !modalContentRef.current.contains(
|
||||
e.target as Node
|
||||
);
|
||||
if (modalContentRef.current) {
|
||||
const clickedOutsideContent = modalContentRef.current.contains(
|
||||
e.target as Node
|
||||
);
|
||||
|
||||
if (clickedOutsideContent) {
|
||||
handleCloseClick();
|
||||
if (clickedOutsideContent) {
|
||||
handleCloseClick();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
2
src/renderer/src/declaration.d.ts
vendored
2
src/renderer/src/declaration.d.ts
vendored
|
@ -62,7 +62,7 @@ declare global {
|
|||
openGameInstaller: (gameId: number) => Promise<boolean>;
|
||||
openGame: (gameId: number, executablePath: string) => Promise<void>;
|
||||
closeGame: (gameId: number) => Promise<boolean>;
|
||||
removeGame: (gameId: number) => Promise<void>;
|
||||
removeGameFromLibrary: (gameId: number) => Promise<void>;
|
||||
deleteGameFolder: (gameId: number) => Promise<unknown>;
|
||||
getGameByObjectID: (objectID: string) => Promise<Game | null>;
|
||||
onPlaytime: (cb: (gameId: number) => void) => () => Electron.IpcRenderer;
|
||||
|
|
|
@ -14,7 +14,10 @@ export const userPreferencesSlice = createSlice({
|
|||
name: "userPreferences",
|
||||
initialState,
|
||||
reducers: {
|
||||
setUserPreferences: (state, action: PayloadAction<UserPreferences>) => {
|
||||
setUserPreferences: (
|
||||
state,
|
||||
action: PayloadAction<UserPreferences | null>
|
||||
) => {
|
||||
state.value = action.payload;
|
||||
},
|
||||
},
|
||||
|
|
|
@ -58,17 +58,17 @@ export function useDownload() {
|
|||
deleteGame(gameId);
|
||||
});
|
||||
|
||||
const removeGame = (gameId: number) =>
|
||||
window.electron.removeGame(gameId).then(() => {
|
||||
const removeGameFromLibrary = (gameId: number) =>
|
||||
window.electron.removeGameFromLibrary(gameId).then(() => {
|
||||
updateLibrary();
|
||||
});
|
||||
|
||||
const isVerifying = ["downloading_metadata", "checking_files"].includes(
|
||||
lastPacket?.game.status
|
||||
lastPacket?.game.status ?? ""
|
||||
);
|
||||
|
||||
const getETA = () => {
|
||||
if (isVerifying || !isFinite(lastPacket?.timeRemaining)) {
|
||||
if (isVerifying || !isFinite(lastPacket?.timeRemaining ?? 0)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ export function useDownload() {
|
|||
pauseDownload,
|
||||
resumeDownload,
|
||||
cancelDownload,
|
||||
removeGame,
|
||||
removeGameFromLibrary,
|
||||
deleteGame,
|
||||
isGameDeleting,
|
||||
clearDownload: () => dispatch(clearDownload()),
|
||||
|
|
|
@ -33,6 +33,7 @@ export function Downloads() {
|
|||
numSeeds,
|
||||
pauseDownload,
|
||||
resumeDownload,
|
||||
removeGameFromLibrary,
|
||||
cancelDownload,
|
||||
deleteGame,
|
||||
isGameDeleting,
|
||||
|
@ -52,11 +53,6 @@ export function Downloads() {
|
|||
updateLibrary();
|
||||
});
|
||||
|
||||
const removeGame = (gameId: number) =>
|
||||
window.electron.removeGame(gameId).then(() => {
|
||||
updateLibrary();
|
||||
});
|
||||
|
||||
const getFinalDownloadSize = (game: Game) => {
|
||||
const isGameDownloading = isDownloading && gameDownloading?.id === game?.id;
|
||||
|
||||
|
@ -194,7 +190,7 @@ export function Downloads() {
|
|||
</Button>
|
||||
|
||||
<Button
|
||||
onClick={() => removeGame(game.id)}
|
||||
onClick={() => removeGameFromLibrary(game.id)}
|
||||
theme="outline"
|
||||
disabled={deleting}
|
||||
>
|
||||
|
|
|
@ -32,7 +32,7 @@ export function HeroPanelActions({
|
|||
resumeDownload,
|
||||
pauseDownload,
|
||||
cancelDownload,
|
||||
removeGame,
|
||||
removeGameFromLibrary,
|
||||
isGameDeleting,
|
||||
} = useDownload();
|
||||
|
||||
|
@ -63,7 +63,7 @@ export function HeroPanelActions({
|
|||
|
||||
try {
|
||||
if (game) {
|
||||
await removeGame(game.id);
|
||||
await removeGameFromLibrary(game.id);
|
||||
} else {
|
||||
const gameExecutablePath = await selectGameExecutable();
|
||||
|
||||
|
@ -187,7 +187,7 @@ export function HeroPanelActions({
|
|||
{t("open_download_options")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => removeGame(game.id).then(getGame)}
|
||||
onClick={() => removeGameFromLibrary(game.id).then(getGame)}
|
||||
theme="outline"
|
||||
disabled={deleting}
|
||||
>
|
||||
|
|
|
@ -25,7 +25,7 @@ export function SelectFolderModal({
|
|||
}: SelectFolderModalProps) {
|
||||
const { t } = useTranslation("game_details");
|
||||
|
||||
const [diskFreeSpace, setDiskFreeSpace] = useState<DiskSpace>(null);
|
||||
const [diskFreeSpace, setDiskFreeSpace] = useState<DiskSpace | null>(null);
|
||||
const [selectedPath, setSelectedPath] = useState("");
|
||||
const [downloadStarting, setDownloadStarting] = useState(false);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ export function SearchResults() {
|
|||
const [searchResults, setSearchResults] = useState<CatalogueEntry[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const debouncedFunc = useRef<DebouncedFunc<() => void | null>>(null);
|
||||
const debouncedFunc = useRef<DebouncedFunc<() => void> | null>(null);
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
@ -39,7 +39,7 @@ export function SearchResults() {
|
|||
|
||||
debouncedFunc.current = debounce(() => {
|
||||
window.electron
|
||||
.searchGames(searchParams.get("query"))
|
||||
.searchGames(searchParams.get("query") ?? "")
|
||||
.then((results) => {
|
||||
setSearchResults(results);
|
||||
})
|
||||
|
|
|
@ -23,10 +23,10 @@ export function Settings() {
|
|||
setForm({
|
||||
downloadsPath: userPreferences?.downloadsPath || path,
|
||||
downloadNotificationsEnabled:
|
||||
userPreferences?.downloadNotificationsEnabled,
|
||||
userPreferences?.downloadNotificationsEnabled ?? false,
|
||||
repackUpdatesNotificationsEnabled:
|
||||
userPreferences?.repackUpdatesNotificationsEnabled,
|
||||
telemetryEnabled: userPreferences?.telemetryEnabled,
|
||||
userPreferences?.repackUpdatesNotificationsEnabled ?? false,
|
||||
telemetryEnabled: userPreferences?.telemetryEnabled ?? false,
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue