diff options
author | Fabian Henneke <FabianHenneke@users.noreply.github.com> | 2020-05-30 21:55:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-30 21:55:14 +0200 |
commit | 81c4960dd68d8e127aa3e7d5e0acd932fef9765e (patch) | |
tree | eaefc53f12b6021d5d9b3dc23462a451839a951e /app/src/main/java | |
parent | cd0b23e0038d27bf38cde1a68f66996eb2d65a07 (diff) |
Fix GitAsyncTask activity handling in error case (#818)
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.kt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.kt b/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.kt index 631bbf88..0b4caadf 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.kt @@ -131,6 +131,10 @@ class GitAsyncTask( is Result.Err -> { e(result.err) operation.onError(rootCauseException(result.err)) + if (finishWithResultOnEnd != null) { + activity?.setResult(Activity.RESULT_CANCELED) + activity?.finish() + } } is Result.Ok -> { operation.onSuccess() @@ -138,11 +142,11 @@ class GitAsyncTask( activity?.setResult(Activity.RESULT_OK, finishWithResultOnEnd) activity?.finish() } - if (refreshListOnEnd) { - (activity as? PasswordStore)?.resetPasswordList() - } } } + if (refreshListOnEnd) { + (activity as? PasswordStore)?.resetPasswordList() + } } } |