Fix: Centralize default download path and enhance path validation logic

This commit is contained in:
MasterAcnolo
2026-02-17 23:29:31 +01:00
parent 45e0840fea
commit 32c9a66a35
6 changed files with 94 additions and 40 deletions

View File

@@ -45,18 +45,15 @@ window.addEventListener("DOMContentLoaded", async () => {
.getElementById("changePath")
.addEventListener("click", async () => {
try {
const selectedPath =
// selectDownloadFolder already returns a validated path
const validatedPath =
await window.electronAPI.selectDownloadFolder();
if (!selectedPath) return; // annulé
// Validation back obligatoire
const validatedPath =
await window.electronAPI.getValidatedDownloadPath(selectedPath);
if (!validatedPath) return; // cancelled
await applyPathFromBack(validatedPath);
} catch (err) {
alert("Dossier non autorisé.");
alert("Folder not allowed.");
}
});
});