Fix error wrongly shown during SSO connection

This commit is contained in:
S1m 2024-01-16 23:27:34 +01:00
parent 3e83f3d07d
commit f328fcc13f
1 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,6 @@ class SSOAccountFactory : AccountFactory {
data: Intent?,
block: (success: Boolean) -> Unit
) {
var success = false
try {
AccountImporter.onActivityResult(
requestCode,
@ -64,10 +63,11 @@ class SSOAccountFactory : AccountFactory {
activity
) { account ->
SingleAccountHelper.commitCurrentAccount(activity.applicationContext, account.name)
success = true
block(true)
}
} catch (_: Exception) {
block(false)
}
} catch (_: AccountImportCancelledException) {}
block(success)
}
override fun getAccount(context: Context): Any? {