File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
downloads/src/main/java/org/openedx/downloads/presentation/download Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -226,10 +226,11 @@ class DownloadsViewModel(
226226 fun removeDownloads (fragmentManager : FragmentManager , courseId : String ) {
227227 logEvent(DownloadsAnalyticsEvent .REMOVE_DOWNLOAD_CLICKED )
228228 viewModelScope.launch {
229- val downloadModels = interactor.getDownloadModels().first().filter {
229+ val downloadModels = interactor.getDownloadModels().first()
230+ val downloadedModels = downloadModels.filter {
230231 it.courseId == courseId && it.downloadedState == DownloadedState .DOWNLOADED
231232 }
232- val totalSize = downloadModels .sumOf { it.size }
233+ val totalSize = downloadedModels .sumOf { it.size }
233234 val title = getCoursePreview(courseId)?.name.orEmpty()
234235 val downloadDialogItem = DownloadDialogItem (
235236 title = title,
You can’t perform that action at this time.
0 commit comments