Skip to content

Commit

Permalink
Fix: Minor folder tree view mode issues (#1052)
Browse files Browse the repository at this point in the history
* fix typo

* fix folder tree deletion
  • Loading branch information
anilbeesetti authored Aug 18, 2024
1 parent 280dcaf commit 4b00844
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GetSortedFolderTreeUseCase @Inject constructor(
preferencesRepository.applicationPreferences,
) { folders, preferences ->
val folder = folderPath?.let {
folders.find { it.path == folderPath }
folders.firstOrNull { it.path == folderPath } ?: return@combine null
} ?: Folder.rootFolder

val nestedFolders = folders.getFoldersFor(path = folder.path, preferences = preferences)
Expand All @@ -36,7 +36,7 @@ class GetSortedFolderTreeUseCase @Inject constructor(
dateModified = folder.dateModified,
mediaList = folder.mediaList.sortedWith(sort.videoComparator()),
folderList = nestedFolders.sortedWith(sort.folderComparator()),
).run { if (folderPath == null) getInitialFolderWithContent() else null }
).run { if (folderPath == null) getInitialFolderWithContent() else this }
}.flowOn(defaultDispatcher)
}

Expand Down

0 comments on commit 4b00844

Please sign in to comment.