Преглед на файлове

extra loader code removed

minhaj преди 2 седмици
родител
ревизия
e3f3849105

+ 0 - 24
app/src/main/java/com/fastest/pass/login/presentation/ui/components/LoginScreen.kt

@@ -154,30 +154,6 @@ fun LoginScreen(
                 }
             }
         }
-
-       /* if (loader) {
-            var progress by remember { mutableFloatStateOf(0.1F) }
-
-            LaunchedEffect(key1 = Unit) {
-                while (true) {
-                    for (i in 1..100) {
-                        progress = i.toFloat()/100F
-                        delay(50)
-                    }
-                    progress = 0.1F
-                }
-            }
-
-            CircularProgressIndicator(
-                progress = { progress },
-                modifier = Modifier
-                    .size(50.dp)
-                    .align(Alignment.Center),
-                color = colorResource(id = R.color.yellow_text),
-                strokeWidth = 5.dp,
-            )
-        }*/
-
     }
 }
 

+ 5 - 26
app/src/main/java/com/fastest/pass/login/presentation/viewmodels/LoginViewModel.kt

@@ -21,25 +21,11 @@ class LoginViewModel @Inject constructor(
     private val loginUseCase: LoginUseCase
 ) : ViewModel() {
 
-    private val _router = MutableStateFlow<LoginRoute>(LoginRoute.OpenNoneScreen)
-    val router: MutableStateFlow<LoginRoute> = _router
-
-  /*  private val _loginResponse = MutableStateFlow<LoginResponse<Any>>(LoginResponse(false, ""))
-    val loginResponse: MutableStateFlow<LoginResponse<Any>> = _loginResponse*/
-
     private var _loginResponse =
         mutableStateOf(UIState<WebResponse<LoginResponse>>())
     val loginResponse: State<UIState<WebResponse<LoginResponse>>> =
         _loginResponse
 
-
-    private val _loader = MutableStateFlow<Boolean>(false)
-    val loader: MutableStateFlow<Boolean> = _loader
-
-    fun navigateTo(loginRoute: LoginRoute) {
-        _router.value = loginRoute
-    }
-
     fun login(email: String, password: String) {
         viewModelScope.launch {
             val request = LoginRequest(email, password)
@@ -61,17 +47,10 @@ class LoginViewModel @Inject constructor(
         }
     }
 
-   /* fun onLoginClicked(email: String, password: String) {
-        viewModelScope.launch {
-            _loader.value = true
-            Log.d("test_api_login", "onLoginClicked => LoginViewModel")
-            val loginResult = loginUseCase(email, password)
-            _loader.value = false
+    private val _router = MutableStateFlow<LoginRoute>(LoginRoute.OpenNoneScreen)
+    val router: MutableStateFlow<LoginRoute> = _router
 
-            if (loginResult.second.status) {
-                _loginResponse.value = loginResult.second
-            }
-            Log.d("loginResult", "loginResult = ${loginResult.second.message}")
-        }
-    }*/
+    fun navigateTo(loginRoute: LoginRoute) {
+        _router.value = loginRoute
+    }
 }