mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
Fix: Centralize default download path and enhance path validation logic
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user