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:
push:
branches: "**"
branches: main
jobs:
build:

View File

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

0
resources/hydra.db Normal file
View File

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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