mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
27 lines
642 B
TypeScript
27 lines
642 B
TypeScript
import { CloudSync } from "@main/services";
|
|
import { registerEvent } from "../register-event";
|
|
import type { GameShop } from "@types";
|
|
import i18next, { t } from "i18next";
|
|
import { formatDate } from "date-fns";
|
|
|
|
const uploadSaveGame = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
objectId: string,
|
|
shop: GameShop,
|
|
downloadOptionTitle: string | null
|
|
) => {
|
|
const { language } = i18next;
|
|
|
|
return CloudSync.uploadSaveGame(
|
|
objectId,
|
|
shop,
|
|
downloadOptionTitle,
|
|
t("backup_from", {
|
|
ns: "game_details",
|
|
date: formatDate(new Date(), language),
|
|
})
|
|
);
|
|
};
|
|
|
|
registerEvent("uploadSaveGame", uploadSaveGame);
|