diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/login/LoginErrorHandler.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/login/LoginErrorHandler.kt index a70ff2d65..76832bdac 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/login/LoginErrorHandler.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/login/LoginErrorHandler.kt @@ -28,5 +28,6 @@ class LoginErrorHandler @Inject constructor( override fun clear() { super.clear() onBadCredentials = {} + onStudentDuplicate = {} } } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormFragment.kt index 94259aa8a..c847d0054 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormFragment.kt @@ -38,8 +38,7 @@ class LoginFormFragment : BaseFragment(), LoginFormView { override val formPassValue get() = loginFormPass.text.toString() - override val formHostValue - get() = hostValues.getOrNull(hostKeys.indexOf(loginFormHost.text.toString())) + override val formHostValue get() = hostValues[(hostKeys.indexOf(loginFormHost.text.toString()))] private lateinit var hostKeys: Array @@ -152,7 +151,7 @@ class LoginFormFragment : BaseFragment(), LoginFormView { Triple( loginFormName.text.toString(), loginFormPass.text.toString(), - resources.getStringArray(R.array.endpoints_values)[1] + formHostValue )) } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormPresenter.kt index 6949200c6..6310f36ac 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormPresenter.kt @@ -40,7 +40,7 @@ class LoginFormPresenter @Inject constructor( view?.apply { clearPassError() clearNameError() - if (formHostValue?.contains("fakelog") == true) setCredentials("jan@fakelog.cf", "jan123") + if (formHostValue.contains("fakelog")) setCredentials("jan@fakelog.cf", "jan123") } } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormView.kt index 2532547a0..3c21e25d4 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/login/form/LoginFormView.kt @@ -11,7 +11,7 @@ interface LoginFormView : BaseView { val formPassValue: String - val formHostValue: String? + val formHostValue: String fun setCredentials(name: String, pass: String)