make sure we hide the Recycle Bin folder if empty

This commit is contained in:
tibbi 2018-06-27 16:34:46 +02:00
parent f54616bf3f
commit 0856abfb83
1 changed files with 10 additions and 3 deletions

View File

@ -864,9 +864,16 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
}
if (getFavoritePaths().isEmpty()) {
val dirsFolder = dirs.firstOrNull { it.areFavorites() }
if (dirsFolder != null) {
invalidDirs.add(dirsFolder)
val favoritesFolder = dirs.firstOrNull { it.areFavorites() }
if (favoritesFolder != null) {
invalidDirs.add(favoritesFolder)
}
}
if (config.useRecycleBin) {
val binFolder = dirs.firstOrNull { it.path == RECYCLE_BIN }
if (binFolder != null && galleryDB.MediumDao().getDeletedMedia().isEmpty()) {
invalidDirs.add(binFolder)
}
}