Support restoring multiple folders imported by dragging

This commit is contained in:
LoveEevee
2021-05-30 07:13:36 +03:00
parent 9c44d223c4
commit 657c631769
2 changed files with 33 additions and 33 deletions

View File

@@ -74,10 +74,15 @@ class Titlescreen{
if(this.customFolder && !fromP2 && !assets.customSongs){
var customSongs = new CustomSongs(this.touched, true)
var soundPlayed = false
customSongs.walkFilesystem(this.customFolder).then(files => {
var promises = []
var allFiles = []
this.customFolder.forEach(file => {
promises.push(customSongs.walkFilesystem(file, undefined, allFiles))
})
Promise.all(promises).then(() => {
assets.sounds["se_don"].play()
soundPlayed = true
return customSongs.importLocal(files)
return customSongs.importLocal(allFiles)
}).catch(() => {
localStorage.removeItem("customSelected")
db.removeItem("customFolder")