From af831cfdbd26b959e5dbacec4611f9abbf27dbca Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Sun, 26 Dec 2021 21:20:11 +0100 Subject: [PATCH] Fixed pressing the save button multiple times creating multiple entries Fixes #691 --- CHANGELOG.md | 4 ++++ .../java/protect/card_locker/LoyaltyCardEditActivity.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 198ce0221..33ee8233f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased - 97 + +- Fixed pressing the save button multiple times creating multiple entries + ## v2.12.0 - 96 (2021-12-23) - Add CODE 93 support diff --git a/app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java b/app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java index 28debd5ae..5e07dbfdb 100644 --- a/app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java +++ b/app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java @@ -1243,6 +1243,11 @@ public class LoyaltyCardEditActivity extends CatimaAppCompatActivity { } private void doSave() { + if (isFinishing()) { + // If we are done saving, ignore any queued up save button presses + return; + } + if (tempStoredOldBarcodeValue != null) { askBarcodeChange(this::doSave); return;