gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 14/35: Sound for Expired


From: gnunet
Subject: [taler-taler-ios] 14/35: Sound for Expired
Date: Thu, 27 Jul 2023 09:09:47 +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 76b66a4ce869b476421041a964454d1ae610734b
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Jul 24 16:05:01 2023 +0200

    Sound for Expired
---
 TalerWallet1/Backend/WalletCore.swift | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/TalerWallet1/Backend/WalletCore.swift 
b/TalerWallet1/Backend/WalletCore.swift
index 0d86cba..3def60d 100644
--- a/TalerWallet1/Backend/WalletCore.swift
+++ b/TalerWallet1/Backend/WalletCore.swift
@@ -186,16 +186,19 @@ extension WalletCore {
         do {
             let decoded = try JSONDecoder().decode(TransactionTransition.self, 
from: jsonData)
             if decoded.newTxState != decoded.oldTxState {
-                if decoded.newTxState.major == .done {
-                    let components = 
decoded.transactionId.components(separatedBy: [":"])
-                    if components.count >= 3 {  // txn:$txtype:$uid
-                        if let type = TransactionType(rawValue: components[1]) 
{
+                let components = decoded.transactionId.components(separatedBy: 
[":"])
+                if components.count >= 3 {  // txn:$txtype:$uid
+                    if let type = TransactionType(rawValue: components[1]) {
+                        guard type != .refresh else { return }
+                        if decoded.newTxState.major == .done {
                             Controller.shared.playSound(type.isIncoming ? 2 : 
1)
+                        } else if decoded.newTxState.major == .expired {
+                            Controller.shared.playSound(0)
                         }
+                        postNotification(.TransactionStateTransition,
+                                         userInfo: [TRANSACTIONTRANSITION: 
decoded])
                     }
                 }
-                postNotification(.TransactionStateTransition,
-                                 userInfo: [TRANSACTIONTRANSITION: decoded])
             }
         } catch {       // rethrows
             symLog.log(jsonData)       // TODO: .error

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]