summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorFabian Henneke <FabianHenneke@users.noreply.github.com>2020-08-23 18:51:36 +0200
committerHarsh Shandilya <me@msfjarvis.dev>2020-08-24 12:46:01 +0530
commita29414fce6b192ab9a7a37938a9596b8511ce06b (patch)
tree10ba986b5e481bd61e66a67ce2894d7b5f2f63d6 /app/src/main/java
parentc4588b9dbf4ca84782ca9e9aba514278bfd8f567 (diff)
Prevent racing double commits on password creation (#1047)
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev> (cherry picked from commit 2c8999c1bff1c82b047e7111d47c539fc6207336)
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
index 1376dd04..44376c0a 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
@@ -426,13 +426,15 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
returnIntent.putExtra(RETURN_EXTRA_USERNAME, username)
}
- lifecycleScope.launch {
- commitChange(
- getString(
- R.string.git_commit_edit_text,
- getLongName(fullPath, repoPath, editName)
+ if (editing) {
+ lifecycleScope.launch {
+ commitChange(
+ getString(
+ R.string.git_commit_edit_text,
+ getLongName(fullPath, repoPath, editName)
+ )
)
- )
+ }
}
if (directoryInputLayout.isVisible && directoryInputLayout.isEnabled && oldFileName != null) {