BugFix for now showing the error message when the phone can't open the file

This commit is contained in:
Vitor Pamplona
2023-05-01 20:43:14 -04:00
parent 82a2586eab
commit 7d620cd89a
@@ -61,11 +61,13 @@ open class NewMediaModel : ViewModel() {
contentResolver.openInputStream(uri)?.use {
createNIP95Record(it.readBytes(), contentType, description)
}
?: viewModelScope.launch {
imageUploadingError.emit("Failed to upload the image / video")
isUploadingImage = false
uploadingPercentage.value = 0.00f
uploadingDescription.value = null
?: run {
viewModelScope.launch {
imageUploadingError.emit("Failed to upload the image / video")
isUploadingImage = false
uploadingPercentage.value = 0.00f
uploadingDescription.value = null
}
}
} else {
uploadingPercentage.value = 0.1f