mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-27 21:01:02 +00:00
refactor: enhance error handling in game queue addition by consolidating promises
This commit is contained in:
@@ -56,12 +56,17 @@ const addGameToQueue = async (
|
||||
|
||||
const updatedGame = await gamesSublevel.get(gameKey);
|
||||
|
||||
await Promise.all([
|
||||
createGame(updatedGame).catch(() => {}),
|
||||
const promises: Promise<unknown>[] = [
|
||||
HydraApi.post(`/games/${shop}/${objectId}/download`, null, {
|
||||
needsAuth: false,
|
||||
}).catch(() => {}),
|
||||
]);
|
||||
];
|
||||
|
||||
if (updatedGame) {
|
||||
promises.push(createGame(updatedGame).catch(() => {}));
|
||||
}
|
||||
|
||||
await Promise.all(promises);
|
||||
|
||||
return { ok: true };
|
||||
} catch (err: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user