Fixes unable to recursively delete when the download folder is not not SAF based

This commit is contained in:
tom5079
2020-11-29 14:01:09 +09:00
parent f07f624fcf
commit dba3460b60

View File

@@ -94,7 +94,12 @@ class ManageStorageFragment : PreferenceFragmentCompat(), Preference.OnPreferenc
}
if (dir.exists())
dir.listFiles()?.forEach { (it as? FileX)?.deleteRecursively() }
dir.listFiles()?.forEach {
when (it) {
is FileX -> it.deleteRecursively()
else -> it.deleteRecursively()
}
}
job = launch {
var size = 0L