[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 07/12: don't beep twice for expirations
From: |
gnunet |
Subject: |
[taler-taler-ios] 07/12: don't beep twice for expirations |
Date: |
Sun, 29 Sep 2024 10:14:23 +0200 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 8b3ce5531cb69b4dc897bf5c226a8ab2a7830a43
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sat Sep 28 09:17:54 2024 +0200
don't beep twice for expirations
---
TalerWallet1/Backend/WalletCore.swift | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/TalerWallet1/Backend/WalletCore.swift
b/TalerWallet1/Backend/WalletCore.swift
index ceaf583..bcf1011 100644
--- a/TalerWallet1/Backend/WalletCore.swift
+++ b/TalerWallet1/Backend/WalletCore.swift
@@ -39,6 +39,8 @@ class WalletCore: QuickjsMessageHandler {
var isLogging: Bool
let logger = Logger(subsystem: "net.taler.gnu", category: "WalletCore")
+ private var expired: [String] = [] // save txID of expired items to
not beep twice
+
private struct FullRequest: Encodable {
let operation: String
let id: UInt
@@ -225,7 +227,12 @@ extension WalletCore {
if let newMinor {
if newMinor == .refreshExpired {
logger.warning("RefreshExpired:
\(decoded.transactionId, privacy: .private(mask: .hash))")
- Controller.shared.playSound(0)
+ if let index = expired.firstIndex(of:
components[2]) {
+ expired.remove(at: index)
// don't beep twice
+ } else {
+ expired.append(components[2])
+ Controller.shared.playSound(0)
// beep at first sight
+ }
postNotification(.TransactionExpired,
userInfo: [TRANSACTIONTRANSITION: decoded])
return
}
@@ -234,9 +241,13 @@ extension WalletCore {
postNotification(.TransactionStateTransition,
userInfo: [TRANSACTIONTRANSITION: decoded])
case .expired:
logger.warning("Expired: \(decoded.transactionId,
privacy: .private(mask: .hash))")
- Controller.shared.playSound(0)
+ if let index = expired.firstIndex(of:
components[2]) {
+ expired.remove(at: index)
// don't beep twice
+ } else {
+ expired.append(components[2])
+ Controller.shared.playSound(0)
// beep at first sight
+ }
postNotification(.TransactionExpired, userInfo:
[TRANSACTIONTRANSITION: decoded])
- return
case .pending:
if let newMinor {
if newMinor == .ready {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (e921612 -> 16eefa4), gnunet, 2024/09/29
- [taler-taler-ios] 03/12: fixedInnerHeight, gnunet, 2024/09/29
- [taler-taler-ios] 02/12: currencyInput, gnunet, 2024/09/29
- [taler-taler-ios] 09/12: filterByState, gnunet, 2024/09/29
- [taler-taler-ios] 01/12: getMaxDepositAmount, getMaxPeerPushDebitAmount, gnunet, 2024/09/29
- [taler-taler-ios] 04/12: cleanup, gnunet, 2024/09/29
- [taler-taler-ios] 06/12: GetMaxPeerPushAmount, gnunet, 2024/09/29
- [taler-taler-ios] 12/12: German localization, gnunet, 2024/09/29
- [taler-taler-ios] 11/12: delete rows (swipeActions), gnunet, 2024/09/29
- [taler-taler-ios] 05/12: dismiss after delete, gnunet, 2024/09/29
- [taler-taler-ios] 07/12: don't beep twice for expirations,
gnunet <=
- [taler-taler-ios] 08/12: strikethrough, gnunet, 2024/09/29
- [taler-taler-ios] 10/12: cleanup, gnunet, 2024/09/29