diff --git a/src/main/events/cloud-save/download-game-artifact.ts b/src/main/events/cloud-save/download-game-artifact.ts index d0e8d845..49c0b4f9 100644 --- a/src/main/events/cloud-save/download-game-artifact.ts +++ b/src/main/events/cloud-save/download-game-artifact.ts @@ -42,6 +42,7 @@ const replaceLudusaviBackupWithCurrentUser = ( // Directories are different, rename if (backupHomeDir !== currentHomeDir) { if (fs.existsSync(newPath)) { + // Ensures that the destination is empty fs.rmSync(newPath, { recursive: true, force: true, diff --git a/src/main/events/cloud-save/upload-save-game.ts b/src/main/events/cloud-save/upload-save-game.ts index 919cfd9e..b7e48d77 100644 --- a/src/main/events/cloud-save/upload-save-game.ts +++ b/src/main/events/cloud-save/upload-save-game.ts @@ -13,6 +13,11 @@ import { app } from "electron"; const bundleBackup = async (shop: GameShop, objectId: string) => { 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); const tarLocation = path.join(backupsPath, `${crypto.randomUUID()}.zip`); diff --git a/src/renderer/src/context/repacks/repacks.context.tsx b/src/renderer/src/context/repacks/repacks.context.tsx index b688793c..cddbb209 100644 --- a/src/renderer/src/context/repacks/repacks.context.tsx +++ b/src/renderer/src/context/repacks/repacks.context.tsx @@ -41,18 +41,15 @@ export function RepacksContextProvider({ children }: RepacksContextProps) { }, []); const indexRepacks = useCallback(() => { - console.log("INDEXING"); setIsIndexingRepacks(true); repacksWorker.postMessage("INDEX_REPACKS"); repacksWorker.onmessage = () => { - console.log("INDEXING COMPLETE"); setIsIndexingRepacks(false); }; }, []); useEffect(() => { - console.log("CALLED"); indexRepacks(); }, [indexRepacks]); diff --git a/src/renderer/src/pages/game-details/cloud-sync-files-modal/cloud-sync-files-modal.tsx b/src/renderer/src/pages/game-details/cloud-sync-files-modal/cloud-sync-files-modal.tsx index f8a31223..9c57c6d2 100644 --- a/src/renderer/src/pages/game-details/cloud-sync-files-modal/cloud-sync-files-modal.tsx +++ b/src/renderer/src/pages/game-details/cloud-sync-files-modal/cloud-sync-files-modal.tsx @@ -11,8 +11,6 @@ export function CloudSyncFilesModal({ }: CloudSyncFilesModalProps) { const { backupPreview } = useContext(cloudSyncContext); - console.log(backupPreview); - const files = useMemo(() => { if (!backupPreview) { return []; diff --git a/src/renderer/src/pages/game-details/hero/hero-panel.tsx b/src/renderer/src/pages/game-details/hero/hero-panel.tsx index d1313db7..7f010705 100644 --- a/src/renderer/src/pages/game-details/hero/hero-panel.tsx +++ b/src/renderer/src/pages/game-details/hero/hero-panel.tsx @@ -29,7 +29,6 @@ export function HeroPanel({ isHeaderStuck }: HeroPanelProps) { const [latestRepack] = repacks; if (latestRepack) { - console.log(latestRepack); const lastUpdate = format(latestRepack.uploadDate!, "dd/MM/yyyy"); const repacksCount = repacks.length; diff --git a/src/renderer/src/pages/profile/edit-profile-modal/edit-profile-modal.tsx b/src/renderer/src/pages/profile/edit-profile-modal/edit-profile-modal.tsx index 0d86bddc..cd43641a 100644 --- a/src/renderer/src/pages/profile/edit-profile-modal/edit-profile-modal.tsx +++ b/src/renderer/src/pages/profile/edit-profile-modal/edit-profile-modal.tsx @@ -64,8 +64,6 @@ export function EditProfileModal( const { showSuccessToast, showErrorToast } = useToast(); const onSubmit = async (values: FormValues) => { - console.log(values); - return patchUser(values) .then(async () => { await Promise.allSettled([fetchUserDetails(), getUserProfile()]); @@ -120,8 +118,6 @@ export function EditProfileModal( return { imagePath: null }; }); - console.log(imagePath); - onChange(imagePath); } };