Fixes the extra empty kind 20 post when uploading videos.

This commit is contained in:
Vitor Pamplona
2025-01-05 11:21:32 -05:00
parent f94feebbd7
commit 617f1ba2a6
@@ -171,22 +171,26 @@ open class NewMediaModel : ViewModel() {
} }
val imageJobs = val imageJobs =
listOf( if (imageUrls.isNotEmpty()) {
viewModelScope.launch(Dispatchers.IO) { listOf(
withTimeoutOrNull(30000) { viewModelScope.launch(Dispatchers.IO) {
suspendCancellableCoroutine { continuation -> withTimeoutOrNull(30000) {
account?.sendAllAsOnePictureEvent( suspendCancellableCoroutine { continuation ->
imageUrls, account?.sendAllAsOnePictureEvent(
caption, imageUrls,
sensitiveContent, caption,
relayList, sensitiveContent,
) { relayList,
continuation.resume(true) ) {
continuation.resume(true)
}
} }
} }
} },
}, )
) } else {
emptyList()
}
nip95jobs.joinAll() nip95jobs.joinAll()
videoJobs.joinAll() videoJobs.joinAll()