From 2c8999c1bff1c82b047e7111d47c539fc6207336 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Sun, 23 Aug 2020 18:51:36 +0200 Subject: Prevent racing double commits on password creation (#1047) Co-authored-by: Harsh Shandilya --- .../com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'app/src/main') 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) { -- cgit v1.2.3