Skip to content

Commit

Permalink
Refuser un téléchargement avec showDirectoryPicker pour passer à la m…
Browse files Browse the repository at this point in the history
…éthode legacy
  • Loading branch information
johan-perso committed Aug 4, 2023
1 parent 2bd782a commit 3c590ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/scriptDownloadPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function downloadAll(el){
el.setAttribute('disabled', true)

// Si on a accès à l'API File System (Chromium)
if(window.showSaveFilePicker && window.showDirectoryPicker){
if(window.showDirectoryPicker){
// Importer Material Toast
var script = document.createElement('script')
script.setAttribute('fetchpriority', 'high')
Expand All @@ -74,6 +74,7 @@ async function downloadAll(el){
// Créer un répertoire
var dirHandle = await showDirectoryPicker({ mode: 'readwrite' }).catch(err => {
mdtoast("Vous devez autoriser l'accès à un dossier pour télécharger tous les fichiers.")
window.showDirectoryPicker = null
return null
})

Expand Down

0 comments on commit 3c590ee

Please sign in to comment.