Exclude instruction from try catch block

This commit is contained in:
Benoit Marty 2021-04-07 14:34:06 +02:00
parent b8d01c4577
commit 1ac17b3aee
1 changed files with 9 additions and 12 deletions

View File

@ -161,25 +161,22 @@ class MainActivity : VectorBaseActivity<ActivityMainBinding>(), UnlockedActivity
lifecycleScope.launch { lifecycleScope.launch {
try { try {
session.signOut(!args.isUserLoggedOut) session.signOut(!args.isUserLoggedOut)
Timber.w("SIGN_OUT: success, start app")
sessionHolder.clearActiveSession()
doLocalCleanup(clearPreferences = true)
startNextActivityAndFinish()
} catch (failure: Throwable) { } catch (failure: Throwable) {
displayError(failure) displayError(failure)
return@launch
} }
Timber.w("SIGN_OUT: success, start app")
sessionHolder.clearActiveSession()
doLocalCleanup(clearPreferences = true)
startNextActivityAndFinish()
} }
} }
args.clearCache -> { args.clearCache -> {
lifecycleScope.launch { lifecycleScope.launch {
try { session.clearCache()
session.clearCache() doLocalCleanup(clearPreferences = false)
doLocalCleanup(clearPreferences = false) session.startSyncing(applicationContext)
session.startSyncing(applicationContext) startNextActivityAndFinish()
startNextActivityAndFinish()
} catch (failure: Throwable) {
displayError(failure)
}
} }
} }
} }