新增错误处理
新增对发布内容的输入校验,并在输入不合法时弹出提示信息。
This commit is contained in:
@@ -48,6 +48,12 @@ object NewPostViewModel : ViewModel() {
|
||||
return tempFile
|
||||
}
|
||||
|
||||
fun validateMoment(): String? {
|
||||
if (imageUriList.isEmpty()) {
|
||||
return "Please select at least one image"
|
||||
}
|
||||
return null
|
||||
}
|
||||
suspend fun createMoment(context: Context, onUploadProgress: (Float) -> Unit) {
|
||||
val uploadImageList = emptyList<UploadImage>().toMutableList()
|
||||
var index = 0
|
||||
|
||||
Reference in New Issue
Block a user