mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-24 05:54:55 +03:00
Merge branch 'main' of github.com:ChristoferMendes/hydra into feature/better-repack-modal
This commit is contained in:
commit
95e802372f
@ -13,27 +13,25 @@ const addGameToLibrary = async (
|
|||||||
gameShop: GameShop,
|
gameShop: GameShop,
|
||||||
executablePath: string | null
|
executablePath: string | null
|
||||||
) => {
|
) => {
|
||||||
const game = await gameRepository.findOne({
|
return gameRepository
|
||||||
where: {
|
.update(
|
||||||
objectID,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (game) {
|
|
||||||
return gameRepository.update(
|
|
||||||
{
|
{
|
||||||
id: game.id,
|
objectID,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shop: gameShop,
|
shop: gameShop,
|
||||||
|
status: null,
|
||||||
executablePath,
|
executablePath,
|
||||||
isDeleted: false,
|
isDeleted: false,
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
.then(async ({ affected }) => {
|
||||||
|
if (!affected) {
|
||||||
|
const iconUrl = await getFileBase64(
|
||||||
|
await getSteamGameIconUrl(objectID)
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
const iconUrl = await getFileBase64(await getSteamGameIconUrl(objectID));
|
|
||||||
|
|
||||||
return gameRepository.insert({
|
await gameRepository.insert({
|
||||||
title,
|
title,
|
||||||
iconUrl,
|
iconUrl,
|
||||||
objectID,
|
objectID,
|
||||||
@ -41,6 +39,7 @@ const addGameToLibrary = async (
|
|||||||
executablePath,
|
executablePath,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
registerEvent(addGameToLibrary, {
|
registerEvent(addGameToLibrary, {
|
||||||
|
@ -95,7 +95,9 @@ export function RepacksModal({
|
|||||||
onClick={() => handleRepackClick(repack)}
|
onClick={() => handleRepackClick(repack)}
|
||||||
className={styles.repackButton}
|
className={styles.repackButton}
|
||||||
>
|
>
|
||||||
<p style={{ color: "#DADBE1" }}>{repack.title}</p>
|
<p style={{ color: "#DADBE1", wordBreak: "break-word" }}>
|
||||||
|
{repack.title}
|
||||||
|
</p>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
|
Loading…
Reference in New Issue
Block a user