deviceData function called
This commit is contained in:
@@ -100,9 +100,12 @@ class HemoCubeFragment : Fragment() {
|
||||
binding.progressBar.visibility = View.GONE
|
||||
}
|
||||
|
||||
hemoCubeViewModel.getDeviceData(sharedPreferences.getString(Constants.USER_ID,""))
|
||||
|
||||
hemoCubeViewModel.deviceData.observe(viewLifecycleOwner) {
|
||||
currentDeviceData = it
|
||||
showToast(calculateRatio(0.17).toString())
|
||||
|
||||
}
|
||||
|
||||
hemoCubeViewModel.networkStatusLiveData.observe(viewLifecycleOwner) { isNetworkAvailable ->
|
||||
|
||||
@@ -62,8 +62,8 @@ class HemoCubeViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun getDeviceData(deviceId: String) = viewModelScope.launch {
|
||||
deviceData.postValue(repository.getDeviceDataById(deviceId))
|
||||
fun getDeviceData(deviceId: String?) = viewModelScope.launch {
|
||||
deviceData.postValue(deviceId?.let { repository.getDeviceDataById(it) })
|
||||
}
|
||||
|
||||
private fun addResultTestToDb() {
|
||||
|
||||
Reference in New Issue
Block a user