mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
23 lines
611 B
TypeScript
23 lines
611 B
TypeScript
import { registerEvent } from "../register-event";
|
|
import { gamesSublevel, levelKeys } from "@main/level";
|
|
import { GameShop } from "@types";
|
|
|
|
const updateLaunchOptions = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
shop: GameShop,
|
|
objectId: string,
|
|
launchOptions: string | null
|
|
) => {
|
|
const gameKey = levelKeys.game(shop, objectId);
|
|
|
|
const game = await gamesSublevel.get(gameKey);
|
|
|
|
if (game) {
|
|
await gamesSublevel.put(gameKey, {
|
|
...game,
|
|
launchOptions: launchOptions?.trim() != "" ? launchOptions : null,
|
|
});
|
|
}
|
|
};
|
|
|
|
registerEvent("updateLaunchOptions", updateLaunchOptions);
|