summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorFabian Henneke <FabianHenneke@users.noreply.github.com>2020-05-30 21:08:38 +0200
committerGitHub <noreply@github.com>2020-05-30 21:08:38 +0200
commitcd0b23e0038d27bf38cde1a68f66996eb2d65a07 (patch)
tree609a2e6ee024cd892e1a89efd5d7dcb1c9447958 /app/src
parent2428d4c0deb5d088112ed10391932acf325e84d5 (diff)
Make commitChange honor finishWithResultOnEnd (#815)
If PasswordRepository.isGitRepo() returns false, commitChange currently doesn't honor the finishWithResultOnEnd parameter, which causes Autofill generate flows to hang on a blank AutofillSaveActivity. This commit lets commitChange mimic what GitAsyncTask does with the parameter. Co-authored-by: Harsh Shandilya <msfjarvis@gmail.com>
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
index 45269145..8c5aa3ae 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
@@ -839,7 +839,13 @@ class PasswordStore : AppCompatActivity() {
private const val PREFERENCE_SEEN_AUTOFILL_ONBOARDING = "seen_autofill_onboarding"
fun commitChange(activity: Activity, message: String, finishWithResultOnEnd: Intent? = null) {
- if (!PasswordRepository.isGitRepo()) return
+ if (!PasswordRepository.isGitRepo()) {
+ if (finishWithResultOnEnd != null) {
+ activity.setResult(Activity.RESULT_OK, finishWithResultOnEnd)
+ activity.finish()
+ }
+ return
+ }
object : GitOperation(getRepositoryDirectory(activity), activity) {
override fun execute() {
tag(TAG).d { "Committing with message $message" }