Fix GitAsyncTask activity handling in error case (#818)
This commit is contained in:
parent
cd0b23e003
commit
81c4960dd6
1 changed files with 7 additions and 3 deletions
|
@ -131,6 +131,10 @@ class GitAsyncTask(
|
||||||
is Result.Err -> {
|
is Result.Err -> {
|
||||||
e(result.err)
|
e(result.err)
|
||||||
operation.onError(rootCauseException(result.err))
|
operation.onError(rootCauseException(result.err))
|
||||||
|
if (finishWithResultOnEnd != null) {
|
||||||
|
activity?.setResult(Activity.RESULT_CANCELED)
|
||||||
|
activity?.finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
is Result.Ok -> {
|
is Result.Ok -> {
|
||||||
operation.onSuccess()
|
operation.onSuccess()
|
||||||
|
@ -138,11 +142,11 @@ class GitAsyncTask(
|
||||||
activity?.setResult(Activity.RESULT_OK, finishWithResultOnEnd)
|
activity?.setResult(Activity.RESULT_OK, finishWithResultOnEnd)
|
||||||
activity?.finish()
|
activity?.finish()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (refreshListOnEnd) {
|
if (refreshListOnEnd) {
|
||||||
(activity as? PasswordStore)?.resetPasswordList()
|
(activity as? PasswordStore)?.resetPasswordList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue