Fix login in symbol view (#493)

This commit is contained in:
Rafał Borcz 2019-09-10 12:25:08 +02:00 committed by Mikołaj Pich
parent 81ce328abd
commit f5f11d5130
4 changed files with 5 additions and 5 deletions

View File

@ -28,5 +28,6 @@ class LoginErrorHandler @Inject constructor(
override fun clear() { override fun clear() {
super.clear() super.clear()
onBadCredentials = {} onBadCredentials = {}
onStudentDuplicate = {}
} }
} }

View File

@ -38,8 +38,7 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
override val formPassValue get() = loginFormPass.text.toString() override val formPassValue get() = loginFormPass.text.toString()
override val formHostValue override val formHostValue get() = hostValues[(hostKeys.indexOf(loginFormHost.text.toString()))]
get() = hostValues.getOrNull(hostKeys.indexOf(loginFormHost.text.toString()))
private lateinit var hostKeys: Array<String> private lateinit var hostKeys: Array<String>
@ -152,7 +151,7 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
Triple( Triple(
loginFormName.text.toString(), loginFormName.text.toString(),
loginFormPass.text.toString(), loginFormPass.text.toString(),
resources.getStringArray(R.array.endpoints_values)[1] formHostValue
)) ))
} }

View File

@ -40,7 +40,7 @@ class LoginFormPresenter @Inject constructor(
view?.apply { view?.apply {
clearPassError() clearPassError()
clearNameError() clearNameError()
if (formHostValue?.contains("fakelog") == true) setCredentials("jan@fakelog.cf", "jan123") if (formHostValue.contains("fakelog")) setCredentials("jan@fakelog.cf", "jan123")
} }
} }

View File

@ -11,7 +11,7 @@ interface LoginFormView : BaseView {
val formPassValue: String val formPassValue: String
val formHostValue: String? val formHostValue: String
fun setCredentials(name: String, pass: String) fun setCredentials(name: String, pass: String)