mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 03:16:02 +03:00
remove nullability
This commit is contained in:
parent
8f4d998362
commit
6d17d51fe9
2 changed files with 12 additions and 14 deletions
|
@ -89,7 +89,7 @@ class Rendezvous(
|
|||
}
|
||||
|
||||
@Throws(RendezvousError::class)
|
||||
suspend fun startAfterScanningCode(): String? {
|
||||
suspend fun startAfterScanningCode(): String {
|
||||
val checksum = channel.connect()
|
||||
|
||||
Timber.tag(TAG).i("Connected to secure channel with checksum: $checksum")
|
||||
|
@ -111,7 +111,7 @@ class Rendezvous(
|
|||
}
|
||||
|
||||
@Throws(RendezvousError::class)
|
||||
suspend fun waitForLoginOnNewDevice(authenticationService: AuthenticationService): Session? {
|
||||
suspend fun waitForLoginOnNewDevice(authenticationService: AuthenticationService): Session {
|
||||
Timber.tag(TAG).i("Waiting for login_token")
|
||||
|
||||
val loginToken = receive()
|
||||
|
|
|
@ -100,21 +100,19 @@ class QrCodeLoginViewModel @AssistedInject constructor(
|
|||
try {
|
||||
val confirmationCode = rendezvous.startAfterScanningCode()
|
||||
Timber.tag(TAG).i("Established secure channel with checksum: $confirmationCode")
|
||||
confirmationCode?.let {
|
||||
onConnectionEstablished(it)
|
||||
val session = rendezvous.waitForLoginOnNewDevice(authenticationService)
|
||||
onSigningIn()
|
||||
session?.let {
|
||||
activeSessionHolder.setActiveSession(session)
|
||||
authenticationService.reset()
|
||||
|
||||
configureAndStartSessionUseCase.execute(session)
|
||||
onConnectionEstablished(confirmationCode)
|
||||
|
||||
rendezvous.completeVerificationOnNewDevice(session)
|
||||
val session = rendezvous.waitForLoginOnNewDevice(authenticationService)
|
||||
onSigningIn()
|
||||
|
||||
_viewEvents.post(QrCodeLoginViewEvents.NavigateToHomeScreen)
|
||||
}
|
||||
}
|
||||
activeSessionHolder.setActiveSession(session)
|
||||
authenticationService.reset()
|
||||
configureAndStartSessionUseCase.execute(session)
|
||||
|
||||
rendezvous.completeVerificationOnNewDevice(session)
|
||||
|
||||
_viewEvents.post(QrCodeLoginViewEvents.NavigateToHomeScreen)
|
||||
} catch (t: Throwable) {
|
||||
Timber.tag(TAG).e(t, "Error occurred during sign in")
|
||||
if (t is RendezvousError) {
|
||||
|
|
Loading…
Reference in a new issue