fix: wrong folder name

This commit is contained in:
Zamitto 2024-12-23 18:55:13 -03:00
parent aa0321df8f
commit 9b9545fb8f
3 changed files with 13 additions and 4 deletions

View file

@ -1,6 +1,7 @@
import { HydraApi } from "@main/services";
import { registerEvent } from "../register-event";
import type { GameArtifact, GameShop } from "@types";
import { SubscriptionRequiredError } from "@shared";
const getGameArtifacts = async (
_event: Electron.IpcMainInvokeEvent,
@ -13,8 +14,16 @@ const getGameArtifacts = async (
});
return HydraApi.get<GameArtifact[]>(
`/profile/games/artifacts?${params.toString()}`
);
`/profile/games/artifacts?${params.toString()}`,
{},
{ needsSubscription: true }
).catch((err) => {
if (err instanceof SubscriptionRequiredError) {
return [];
}
throw err;
});
};
registerEvent("getGameArtifacts", getGameArtifacts);

View file

@ -13,7 +13,7 @@ export class UserNotLoggedInError extends Error {
export class SubscriptionRequiredError extends Error {
constructor() {
super("user does not have hydra cloud subscription");
this.name = "UserWithoutCloudSubscriptionError";
this.name = "SubscriptionRequiredError";
}
}