refactor: streamline promise handling in addGameToQueue function for improved error management

This commit is contained in:
Moyasee
2026-01-30 12:37:40 +02:00
parent d8cbd80541
commit 52ff39a098

View File

@@ -56,17 +56,12 @@ const addGameToQueue = async (
const updatedGame = await gamesSublevel.get(gameKey);
const promises: Promise<unknown>[] = [
await Promise.all([
createGame(updatedGame!).catch(() => {}),
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) {