Cleanup after BillCarsonFr's review

This commit is contained in:
Benoit Marty 2019-09-17 11:24:37 +02:00
parent 07e99901e1
commit 993fa74252
2 changed files with 11 additions and 6 deletions

View File

@ -34,6 +34,7 @@ import im.vector.riotx.core.extensions.configureAndStart
import im.vector.riotx.core.platform.VectorViewModel import im.vector.riotx.core.platform.VectorViewModel
import im.vector.riotx.core.utils.LiveEvent import im.vector.riotx.core.utils.LiveEvent
import im.vector.riotx.features.notifications.PushRuleTriggerListener import im.vector.riotx.features.notifications.PushRuleTriggerListener
import timber.log.Timber
class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginViewState, class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginViewState,
private val authenticator: Authenticator, private val authenticator: Authenticator,
@ -123,9 +124,16 @@ class LoginViewModel @AssistedInject constructor(@Assisted initialState: LoginVi
} }
private fun handleSsoLoginSuccess(action: LoginActions.SsoLoginSuccess) { private fun handleSsoLoginSuccess(action: LoginActions.SsoLoginSuccess) {
val session = authenticator.createSessionFromSso(action.credentials, homeServerConnectionConfig!!) val homeServerConnectionConfigFinal = homeServerConnectionConfig
onSessionCreated(session) if (homeServerConnectionConfigFinal == null) {
// Should not happen
Timber.w("homeServerConnectionConfig is null")
} else {
val session = authenticator.createSessionFromSso(action.credentials, homeServerConnectionConfigFinal)
onSessionCreated(session)
}
} }

View File

@ -1,15 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listView_spinner_views"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/vctr_waiting_background_color"> android:background="?attr/vctr_waiting_background_color">
<ProgressBar <ProgressBar
android:id="@+id/listView_spinner"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="center" android:layout_gravity="center" />
android:visibility="visible" />
</FrameLayout> </FrameLayout>