秤精度精确到0.1g并接口因此产生的数据问题;提交页面初始不为0优化;设置页面引起页面跳转问题优化;初始化版本使用项目versionCode
This commit is contained in:
@@ -150,14 +150,13 @@ class AppViewModel(private val rep: AppRepository) : ViewModel() {
|
||||
// }
|
||||
|
||||
private var isProcessing = false
|
||||
fun loadSeasoning(action: (list: MutableList<SeasoningEntity>) -> Unit) {
|
||||
fun loadSeasoning(action: (MutableList<SeasoningEntity>) -> Unit) {
|
||||
viewModelScope.launch {
|
||||
if (isProcessing) return@launch
|
||||
isProcessing = true
|
||||
rep.getAllStream().collect { list ->
|
||||
action(list)
|
||||
isProcessing = false
|
||||
}
|
||||
val list = rep.getAllStream()
|
||||
action(list)
|
||||
isProcessing = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +196,8 @@ class AppViewModel(private val rep: AppRepository) : ViewModel() {
|
||||
}
|
||||
}
|
||||
entity.id = 0
|
||||
rep.insertSeasoning(entity)
|
||||
val id = rep.insertSeasoning(entity)
|
||||
entity.id = id
|
||||
block()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user