fix download completion dialog shows up even if its disabled (#393)

This commit is contained in:
AmirHossein Abdolmotallebi 2025-02-04 20:06:08 +03:30 committed by GitHub
parent ae89edda6b
commit 0488fc1df5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,9 +81,10 @@ class SingleDownloadComponent(
init {
downloadMonitor
.downloadListFlow
// .conflate()
.map { it.firstOrNull { it.id == downloadId } }
.distinctUntilChanged()
.onEach {
val item = it.firstOrNull { it.id == downloadId }
val item = it
val previous = itemStateFlow.value
if (previous is ProcessingDownloadItemState && item is CompletedDownloadItemState) {
// if It was opened to show progress