mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
Merge branch 'feature/cloud-sync' into feature/game-achievements
This commit is contained in:
commit
f5445b00f4
6 changed files with 6 additions and 10 deletions
|
@ -42,6 +42,7 @@ const replaceLudusaviBackupWithCurrentUser = (
|
||||||
// Directories are different, rename
|
// Directories are different, rename
|
||||||
if (backupHomeDir !== currentHomeDir) {
|
if (backupHomeDir !== currentHomeDir) {
|
||||||
if (fs.existsSync(newPath)) {
|
if (fs.existsSync(newPath)) {
|
||||||
|
// Ensures that the destination is empty
|
||||||
fs.rmSync(newPath, {
|
fs.rmSync(newPath, {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true,
|
force: true,
|
||||||
|
|
|
@ -13,6 +13,11 @@ import { app } from "electron";
|
||||||
const bundleBackup = async (shop: GameShop, objectId: string) => {
|
const bundleBackup = async (shop: GameShop, objectId: string) => {
|
||||||
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
|
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
|
||||||
|
|
||||||
|
// Remove existing backup
|
||||||
|
if (fs.existsSync(backupPath)) {
|
||||||
|
fs.rmSync(backupPath, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
await Ludusavi.backupGame(shop, objectId, backupPath);
|
await Ludusavi.backupGame(shop, objectId, backupPath);
|
||||||
|
|
||||||
const tarLocation = path.join(backupsPath, `${crypto.randomUUID()}.zip`);
|
const tarLocation = path.join(backupsPath, `${crypto.randomUUID()}.zip`);
|
||||||
|
|
|
@ -41,18 +41,15 @@ export function RepacksContextProvider({ children }: RepacksContextProps) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const indexRepacks = useCallback(() => {
|
const indexRepacks = useCallback(() => {
|
||||||
console.log("INDEXING");
|
|
||||||
setIsIndexingRepacks(true);
|
setIsIndexingRepacks(true);
|
||||||
repacksWorker.postMessage("INDEX_REPACKS");
|
repacksWorker.postMessage("INDEX_REPACKS");
|
||||||
|
|
||||||
repacksWorker.onmessage = () => {
|
repacksWorker.onmessage = () => {
|
||||||
console.log("INDEXING COMPLETE");
|
|
||||||
setIsIndexingRepacks(false);
|
setIsIndexingRepacks(false);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("CALLED");
|
|
||||||
indexRepacks();
|
indexRepacks();
|
||||||
}, [indexRepacks]);
|
}, [indexRepacks]);
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@ export function CloudSyncFilesModal({
|
||||||
}: CloudSyncFilesModalProps) {
|
}: CloudSyncFilesModalProps) {
|
||||||
const { backupPreview } = useContext(cloudSyncContext);
|
const { backupPreview } = useContext(cloudSyncContext);
|
||||||
|
|
||||||
console.log(backupPreview);
|
|
||||||
|
|
||||||
const files = useMemo(() => {
|
const files = useMemo(() => {
|
||||||
if (!backupPreview) {
|
if (!backupPreview) {
|
||||||
return [];
|
return [];
|
||||||
|
|
|
@ -29,7 +29,6 @@ export function HeroPanel({ isHeaderStuck }: HeroPanelProps) {
|
||||||
const [latestRepack] = repacks;
|
const [latestRepack] = repacks;
|
||||||
|
|
||||||
if (latestRepack) {
|
if (latestRepack) {
|
||||||
console.log(latestRepack);
|
|
||||||
const lastUpdate = format(latestRepack.uploadDate!, "dd/MM/yyyy");
|
const lastUpdate = format(latestRepack.uploadDate!, "dd/MM/yyyy");
|
||||||
const repacksCount = repacks.length;
|
const repacksCount = repacks.length;
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,6 @@ export function EditProfileModal(
|
||||||
const { showSuccessToast, showErrorToast } = useToast();
|
const { showSuccessToast, showErrorToast } = useToast();
|
||||||
|
|
||||||
const onSubmit = async (values: FormValues) => {
|
const onSubmit = async (values: FormValues) => {
|
||||||
console.log(values);
|
|
||||||
|
|
||||||
return patchUser(values)
|
return patchUser(values)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await Promise.allSettled([fetchUserDetails(), getUserProfile()]);
|
await Promise.allSettled([fetchUserDetails(), getUserProfile()]);
|
||||||
|
@ -120,8 +118,6 @@ export function EditProfileModal(
|
||||||
return { imagePath: null };
|
return { imagePath: null };
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(imagePath);
|
|
||||||
|
|
||||||
onChange(imagePath);
|
onChange(imagePath);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue