mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 22:35:17 +00:00
Fix GitAsyncTask activity handling in error case (#818)
This commit is contained in:
@@ -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) {
|
|
||||||
(activity as? PasswordStore)?.resetPasswordList()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (refreshListOnEnd) {
|
||||||
|
(activity as? PasswordStore)?.resetPasswordList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user