diff options
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt index cf9c3442..53ed3461 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt @@ -613,7 +613,7 @@ open class GitActivity : AppCompatActivity() { } } - override fun onActivityResult( + public override fun onActivityResult( requestCode: Int, resultCode: Int, data: Intent? @@ -625,9 +625,17 @@ open class GitActivity : AppCompatActivity() { // background thread - the actual signing of the SSH challenge. We pass through the // completed signature to the ApiIdentity, which will be blocked in the other thread // waiting for it. - if (requestCode == SshApiSessionFactory.POST_SIGNATURE && identity != null) + if (requestCode == SshApiSessionFactory.POST_SIGNATURE && identity != null) { identity!!.postSignature(data) + // If the signature failed (usually because it was cancelled), reset state + if (data == null) { + identity = null + identityBuilder = null + } + return + } + if (resultCode == AppCompatActivity.RESULT_CANCELED) { setResult(AppCompatActivity.RESULT_CANCELED) finish() |
