Merge branch 'main' into feat/reviews-and-commenting

This commit is contained in:
Zamitto
2025-10-10 14:50:46 -03:00
committed by GitHub
7 changed files with 21 additions and 7 deletions

View File

@@ -253,6 +253,7 @@
"uploading_backup": "Uploading backup…",
"no_backups": "You haven't created any backups for this game yet",
"backup_uploaded": "Backup uploaded",
"backup_failed": "Backup failed",
"backup_deleted": "Backup deleted",
"backup_restored": "Backup restored",
"see_all_achievements": "See all achievements",

View File

@@ -204,6 +204,7 @@
"uploading_backup": "Subiendo copia de seguridad…",
"no_backups": "No has creado ninguna copia de seguridad para este juego todavía",
"backup_uploaded": "Copia de seguridad subida",
"backup_failed": "Copia de seguridad fallida",
"backup_deleted": "Copia de seguridad eliminada",
"backup_restored": "Copia de seguridad restaurada",
"see_all_achievements": "Ver todos los logros",

View File

@@ -142,6 +142,7 @@
"uploading_backup": "A criar backup…",
"no_backups": "Ainda não fizeste nenhum backup deste jogo",
"backup_uploaded": "Backup criado",
"backup_failed": "Falha ao criar backup",
"backup_deleted": "Backup apagado",
"backup_restored": "Backup restaurado",
"see_all_achievements": "Ver todas as conquistas",

View File

@@ -80,7 +80,7 @@ export class CloudSync {
try {
await fs.promises.rm(backupPath, { recursive: true });
} catch (error) {
logger.error("Failed to remove backup path", error);
logger.error("Failed to remove backup path", { backupPath, error });
}
}
@@ -163,7 +163,7 @@ export class CloudSync {
try {
await fs.promises.unlink(bundleLocation);
} catch (error) {
logger.error("Failed to remove tar file", error);
logger.error("Failed to remove tar file", { bundleLocation, error });
}
}
}

View File

@@ -22,7 +22,8 @@ export const mergeWithRemoteGames = async () => {
const updatedLastTimePlayed =
localGame.lastTimePlayed == null ||
(game.lastTimePlayed &&
new Date(game.lastTimePlayed) > localGame.lastTimePlayed)
new Date(game.lastTimePlayed) >
new Date(localGame.lastTimePlayed))
? game.lastTimePlayed
: localGame.lastTimePlayed;

View File

@@ -76,7 +76,11 @@ export const getSteamAppDetails = async (
return null;
})
.catch((err) => {
logger.error(err, { method: "getSteamAppDetails" });
logger.error("Error on getSteamAppDetails", {
message: err?.message,
code: err?.code,
name: err?.name,
});
return null;
});
};

View File

@@ -87,7 +87,7 @@ export function CloudSyncContextProvider({
const [loadingPreview, setLoadingPreview] = useState(false);
const [freezingArtifact, setFreezingArtifact] = useState(false);
const { showSuccessToast } = useToast();
const { showSuccessToast, showErrorToast } = useToast();
const downloadGameArtifact = useCallback(
async (gameArtifactId: string) => {
@@ -122,9 +122,15 @@ export function CloudSyncContextProvider({
const uploadSaveGame = useCallback(
async (downloadOptionTitle: string | null) => {
setUploadingBackup(true);
window.electron.uploadSaveGame(objectId, shop, downloadOptionTitle);
window.electron
.uploadSaveGame(objectId, shop, downloadOptionTitle)
.catch((err) => {
setUploadingBackup(false);
logger.error("Failed to upload save game", { objectId, shop, err });
showErrorToast(t("backup_failed"));
});
},
[objectId, shop]
[objectId, shop, t, showErrorToast]
);
const toggleArtifactFreeze = useCallback(