mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: migrating user preferences
This commit is contained in:
parent
d760d0139d
commit
f1e0ba4dd6
53 changed files with 737 additions and 790 deletions
|
@ -1,5 +1,5 @@
|
|||
import { registerEvent } from "../register-event";
|
||||
import { levelKeys } from "@main/level";
|
||||
import { downloadsSublevel, levelKeys } from "@main/level";
|
||||
import { gamesSublevel } from "@main/level";
|
||||
import type { GameShop } from "@types";
|
||||
|
||||
|
@ -9,9 +9,14 @@ const getGameByObjectId = async (
|
|||
objectId: string
|
||||
) => {
|
||||
const gameKey = levelKeys.game(shop, objectId);
|
||||
const game = await gamesSublevel.get(gameKey);
|
||||
const [game, download] = await Promise.all([
|
||||
gamesSublevel.get(gameKey),
|
||||
downloadsSublevel.get(gameKey),
|
||||
]);
|
||||
|
||||
return game;
|
||||
if (!game) return null;
|
||||
|
||||
return { id: gameKey, ...game, download };
|
||||
};
|
||||
|
||||
registerEvent("getGameByObjectId", getGameByObjectId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue