mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 16:53:57 +00:00
24 lines
579 B
TypeScript
24 lines
579 B
TypeScript
import { registerEvent } from "../register-event";
|
|
import { levelKeys, gamesSublevel } from "@main/level";
|
|
import type { GameShop } from "@types";
|
|
|
|
const toggleAutomaticCloudSync = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
shop: GameShop,
|
|
objectId: string,
|
|
automaticCloudSync: boolean
|
|
) => {
|
|
const gameKey = levelKeys.game(shop, objectId);
|
|
|
|
const game = await gamesSublevel.get(gameKey);
|
|
|
|
if (!game) return;
|
|
|
|
await gamesSublevel.put(gameKey, {
|
|
...game,
|
|
automaticCloudSync,
|
|
});
|
|
};
|
|
|
|
registerEvent("toggleAutomaticCloudSync", toggleAutomaticCloudSync);
|