refactor: enhance error handling in game queue addition by consolidating promises

This commit is contained in:
Moyasee
2026-01-26 18:58:29 +02:00
parent db8da467e8
commit 289b59074c

View File

@@ -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) {