feat: setting to hide red dot

This commit is contained in:
rebelonion 2024-05-27 05:58:51 -05:00
parent 0b32636c1b
commit b30047804a
8 changed files with 41 additions and 8 deletions

View file

@ -349,7 +349,8 @@ class DownloadsManager(private val context: Context) {
private fun getBaseDirectory(context: Context): DocumentFile? {
val baseDirectory = Uri.parse(PrefManager.getVal<String>(PrefName.DownloadsDir))
if (baseDirectory == Uri.EMPTY) return null
return DocumentFile.fromTreeUri(context, baseDirectory)
val base = DocumentFile.fromTreeUri(context, baseDirectory) ?: return null
return base.findOrCreateFolder(BASE_LOCATION, false)
}
private val lock = Any()
@ -364,7 +365,7 @@ class DownloadsManager(private val context: Context) {
createDirectory(validName)
} else {
val folder = findFolder(validName)
return folder ?: createDirectory(validName)
folder ?: createDirectory(validName)
}
}
}