fix: variables not initialized before constructor execution

This commit is contained in:
andrekir
2023-10-19 17:16:16 -03:00
parent 3c18b2535e
commit f3e57c05e4

View File

@@ -143,6 +143,9 @@ class UIViewModel @Inject constructor(
private val requestIds = MutableStateFlow<HashMap<Int, Boolean>>(hashMapOf())
private val _snackbarText = MutableLiveData<Any?>(null)
val snackbarText: LiveData<Any?> get() = _snackbarText
init {
radioInterfaceService.errorMessage.filterNotNull().onEach {
_snackbarText.value = it
@@ -318,9 +321,6 @@ class UIViewModel @Inject constructor(
_requestChannelUrl.value = null
}
private val _snackbarText = MutableLiveData<Any?>(null)
val snackbarText: LiveData<Any?> get() = _snackbarText
fun showSnackbar(resString: Any) {
_snackbarText.value = resString
}