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()) { if (getFavoritePaths().isEmpty()) {
val dirsFolder = dirs.firstOrNull { it.areFavorites() } val favoritesFolder = dirs.firstOrNull { it.areFavorites() }
if (dirsFolder != null) { if (favoritesFolder != null) {
invalidDirs.add(dirsFolder) invalidDirs.add(favoritesFolder)
}
}
if (config.useRecycleBin) {
val binFolder = dirs.firstOrNull { it.path == RECYCLE_BIN }
if (binFolder != null && galleryDB.MediumDao().getDeletedMedia().isEmpty()) {
invalidDirs.add(binFolder)
} }
} }