aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFabian Henneke <FabianHenneke@users.noreply.github.com>2020-08-23 18:51:36 +0200
committerGitHub <noreply@github.com>2020-08-23 22:21:36 +0530
commit2c8999c1bff1c82b047e7111d47c539fc6207336 (patch)
tree5b71e73e9017faabee93e51d5ed290a02b085136 /app
parent06497f1db0782edb587cf83825f0400dffb0c2e1 (diff)
Prevent racing double commits on password creation (#1047)
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app')
-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 c5d3d70a..ff5a8179 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
@@ -440,13 +440,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) {