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

View File

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