mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
adjustments
This commit is contained in:
parent
9af6b10f67
commit
86798bb352
4 changed files with 20 additions and 12 deletions
|
|
@ -12,10 +12,14 @@ const addGameToFavorites = async (
|
|||
const game = await gamesSublevel.get(gameKey);
|
||||
if (!game) return;
|
||||
|
||||
await gamesSublevel.put(gameKey, {
|
||||
...game,
|
||||
favorite: true,
|
||||
});
|
||||
try {
|
||||
await gamesSublevel.put(gameKey, {
|
||||
...game,
|
||||
favorite: true,
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to update game favorite status: ${error}`);
|
||||
}
|
||||
};
|
||||
|
||||
registerEvent("addGameToFavorites", addGameToFavorites);
|
||||
|
|
|
|||
|
|
@ -12,10 +12,14 @@ const removeGameFromFavorites = async (
|
|||
const game = await gamesSublevel.get(gameKey);
|
||||
if (!game) return;
|
||||
|
||||
await gamesSublevel.put(gameKey, {
|
||||
...game,
|
||||
favorite: false,
|
||||
});
|
||||
try {
|
||||
await gamesSublevel.put(gameKey, {
|
||||
...game,
|
||||
favorite: false,
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to update game favorite status: ${error}`);
|
||||
}
|
||||
};
|
||||
|
||||
registerEvent("removeGameFromFavorites", removeGameFromFavorites);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue