Fix GitAsyncTask activity handling in error case (#818)

This commit is contained in:
Fabian Henneke 2020-05-30 21:55:14 +02:00 committed by GitHub
parent cd0b23e003
commit 81c4960dd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()
}
}
}
}
}