fix: fixing typecheck errors

This commit is contained in:
Hydra 2024-04-30 03:27:07 +01:00
parent 733a471c9b
commit 8383cb9070
9 changed files with 19 additions and 16 deletions

View File

@ -2,7 +2,7 @@ name: Build
on: on:
push: push:
branches: "**" branches: main
jobs: jobs:
build: build:

View File

@ -2,10 +2,10 @@ name: Contributors
on: on:
push: push:
branches: "**" branches: main
jobs: jobs:
lint: contributors:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

0
resources/hydra.db Normal file
View File

View File

@ -109,7 +109,7 @@ export const resolveDatabaseUpdates = async () => {
const updateDataSource = createDataSource({ const updateDataSource = createDataSource({
database: app.isPackaged database: app.isPackaged
? path.join(process.resourcesPath, "hydra.db") ? path.join(process.resourcesPath, "hydra.db")
: path.join(__dirname, "..", "..", "resources", "hydra.db"), : path.join(__dirname, "..", "..", "hydra.db"),
}); });
return updateDataSource.initialize().then(async () => { return updateDataSource.initialize().then(async () => {

View File

@ -21,6 +21,7 @@ declare global {
startGameDownload: ( startGameDownload: (
repackId: number, repackId: number,
objectID: string, objectID: string,
title: string,
shop: GameShop, shop: GameShop,
downloadPath: string downloadPath: string
) => Promise<Game>; ) => Promise<Game>;

View File

@ -75,7 +75,7 @@ export function GameDetails() {
const getGame = useCallback(() => { const getGame = useCallback(() => {
window.electron window.electron
.getGameByObjectID(objectID) .getGameByObjectID(objectID!)
.then((result) => setGame(result)); .then((result) => setGame(result));
}, [setGame, objectID]); }, [setGame, objectID]);
@ -92,7 +92,7 @@ export function GameDetails() {
getRandomGame(); getRandomGame();
window.electron window.electron
.getGameShopDetails(objectID, "steam", getSteamLanguage(i18n.language)) .getGameShopDetails(objectID!, "steam", getSteamLanguage(i18n.language))
.then((result) => { .then((result) => {
if (!result) { if (!result) {
navigate(-1); navigate(-1);
@ -100,7 +100,7 @@ export function GameDetails() {
} }
window.electron window.electron
.getHowLongToBeat(objectID, "steam", result.name) .getHowLongToBeat(objectID!, "steam", result.name)
.then((data) => { .then((data) => {
setHowLongToBeat({ isLoading: false, data }); setHowLongToBeat({ isLoading: false, data });
}); });
@ -191,7 +191,7 @@ export function GameDetails() {
<section className={styles.container}> <section className={styles.container}>
<div className={styles.hero}> <div className={styles.hero}>
<AsyncImage <AsyncImage
src={steamUrlBuilder.libraryHero(objectID)} src={steamUrlBuilder.libraryHero(objectID!)}
className={styles.heroImage} className={styles.heroImage}
alt={game?.title} alt={game?.title}
onSettled={handleImageSettled} onSettled={handleImageSettled}
@ -199,7 +199,7 @@ export function GameDetails() {
<div className={styles.heroBackdrop}> <div className={styles.heroBackdrop}>
<div className={styles.heroContent}> <div className={styles.heroContent}>
<AsyncImage <AsyncImage
src={steamUrlBuilder.logo(objectID)} src={steamUrlBuilder.logo(objectID!)}
style={{ width: 300, alignSelf: "flex-end" }} style={{ width: 300, alignSelf: "flex-end" }}
/> />
</div> </div>

View File

@ -29,7 +29,7 @@ export function RepacksModal({
onClose, onClose,
}: RepacksModalProps) { }: RepacksModalProps) {
const [filteredRepacks, setFilteredRepacks] = useState<GameRepack[]>([]); const [filteredRepacks, setFilteredRepacks] = useState<GameRepack[]>([]);
const [repack, setRepack] = useState<GameRepack>(null); const [repack, setRepack] = useState<GameRepack | null>(null);
const repackersFriendlyNames = useAppSelector( const repackersFriendlyNames = useAppSelector(
(state) => state.repackersFriendlyNames.value (state) => state.repackersFriendlyNames.value

View File

@ -13,7 +13,7 @@ export interface SelectFolderModalProps {
gameDetails: ShopDetails; gameDetails: ShopDetails;
onClose: () => void; onClose: () => void;
startDownload: (repackId: number, downloadPath: string) => Promise<void>; startDownload: (repackId: number, downloadPath: string) => Promise<void>;
repack: GameRepack; repack: GameRepack | null;
} }
export function SelectFolderModal({ export function SelectFolderModal({
@ -61,10 +61,12 @@ export function SelectFolderModal({
}; };
const handleStartClick = () => { const handleStartClick = () => {
setDownloadStarting(true); if (repack) {
startDownload(repack.id, selectedPath).finally(() => { setDownloadStarting(true);
setDownloadStarting(false); startDownload(repack.id, selectedPath).finally(() => {
}); setDownloadStarting(false);
});
}
}; };
return ( return (

View File

@ -51,7 +51,7 @@ export function Home() {
const handleSelectCategory = (category: CatalogueCategory) => { const handleSelectCategory = (category: CatalogueCategory) => {
if (category !== currentCategory) { if (category !== currentCategory) {
getCatalogue(category); getCatalogue(category);
navigate(`/?category=${category}`, { replace: true }); navigate(`/?category=${category}`);
} }
}; };