aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-12 18:54:51 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-12 18:54:51 -0600
commitec778f53323aa3844eadc0aae4c647d2e3a23d20 (patch)
treed093150da23333b9e9b025c6c10ce06e7f51a128 /androidApp/src/main/java/mx/trackermap/TrackerMap/android/session
parent9cdf080dfb589c748928657c8ce0a53b3959d3a8 (diff)
downloadetbsa-trackermap-mobile-ec778f53323aa3844eadc0aae4c647d2e3a23d20.tar.gz
etbsa-trackermap-mobile-ec778f53323aa3844eadc0aae4c647d2e3a23d20.tar.bz2
etbsa-trackermap-mobile-ec778f53323aa3844eadc0aae4c647d2e3a23d20.zip
Fix code style and replaced this to viewLifecycleOwner in observers to avoid leaks
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android/session')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt
index cc84f06..674c2d3 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt
@@ -10,10 +10,12 @@ import android.widget.Toast
import androidx.core.widget.doAfterTextChanged
import androidx.fragment.app.Fragment
import com.zhuinden.liveevent.observe
+import kotlinx.coroutines.DelicateCoroutinesApi
import mx.trackermap.TrackerMap.android.databinding.LoginBinding
import mx.trackermap.TrackerMap.android.units.UnitsActivity
import org.koin.androidx.viewmodel.ext.android.viewModel
+@DelicateCoroutinesApi
class LoginFragment : Fragment() {
private var _binding: LoginBinding? = null
private val binding get() = _binding!!
@@ -54,7 +56,7 @@ class LoginFragment : Fragment() {
}
private fun setupObservers() {
- loginViewModel.loginState.observe(this) { result ->
+ loginViewModel.loginState.observe(viewLifecycleOwner) { result ->
Log.d("LoginFragment", result.toString())
when (result) {
LoginViewModel.LoginState.Loading -> {