gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 138/204: recvDisabled


From: gnunet
Subject: [taler-taler-ios] 138/204: recvDisabled
Date: Thu, 05 Dec 2024 23:51:46 +0100

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 af8c222dde2ee05c94f7887a330ffcacb7b3dcc9
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Nov 18 16:09:52 2024 +0100

    recvDisabled
---
 TalerWallet1/Views/Actions/ActionsSheet.swift     | 5 +++--
 TalerWallet1/Views/Actions/DepositWithdrawV.swift | 2 ++
 TalerWallet1/Views/Actions/SendRequestV.swift     | 2 ++
 TalerWallet1/Views/Actions/TwoRowButtons.swift    | 7 +++++--
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/TalerWallet1/Views/Actions/ActionsSheet.swift 
b/TalerWallet1/Views/Actions/ActionsSheet.swift
index 566d6a0..1047696 100644
--- a/TalerWallet1/Views/Actions/ActionsSheet.swift
+++ b/TalerWallet1/Views/Actions/ActionsSheet.swift
@@ -77,8 +77,9 @@ struct ActionsSheet: View {
             }
 
             let sendDisabled = !canSend
-            SendRequestV(stack: stack.push(), sendDisabled: sendDisabled)
-            DepositWithdrawV(stack: stack.push(), sendDisabled: sendDisabled)
+            let recvDisabled = controller.balances.count == 0
+            SendRequestV(stack: stack.push(), sendDisabled: sendDisabled, 
recvDisabled: recvDisabled)
+            DepositWithdrawV(stack: stack.push(), sendDisabled: sendDisabled, 
recvDisabled: recvDisabled)
             QRButton(isNavBarItem: false) {
                 qrButtonTapped = true
             }
diff --git a/TalerWallet1/Views/Actions/DepositWithdrawV.swift 
b/TalerWallet1/Views/Actions/DepositWithdrawV.swift
index fed3ba4..62f0aca 100644
--- a/TalerWallet1/Views/Actions/DepositWithdrawV.swift
+++ b/TalerWallet1/Views/Actions/DepositWithdrawV.swift
@@ -11,6 +11,7 @@ import SwiftUI
 struct DepositWithdrawV: View {
     let stack: CallStack
     let sendDisabled: Bool   // can't send/deposit if wallet has no coins at 
all
+    let recvDisabled: Bool   // can't receive/withdraw if wallet has no 
payments services
 
     var body: some View {
         let depositTitle = String(localized: "DepositButton_Short", 
defaultValue: "Deposit",
@@ -26,6 +27,7 @@ struct DepositWithdrawV: View {
                    recvA11y: withdrawTitle,
                sendDisabled: sendDisabled,
                  sendAction: .DepositAction,
+               recvDisabled: recvDisabled,
                  recvAction: .WithdrawAction)
     }
 }
diff --git a/TalerWallet1/Views/Actions/SendRequestV.swift 
b/TalerWallet1/Views/Actions/SendRequestV.swift
index 42cfa59..6c604cb 100644
--- a/TalerWallet1/Views/Actions/SendRequestV.swift
+++ b/TalerWallet1/Views/Actions/SendRequestV.swift
@@ -11,6 +11,7 @@ import SwiftUI
 struct SendRequestV: View {
     let stack: CallStack
     let sendDisabled: Bool   // can't send/deposit if wallet has no coins at 
all
+    let recvDisabled: Bool   // can't receive/withdraw if wallet has no 
payments services
 
     var body: some View {
         let sendTitle = String(localized: "SendButton_Short", defaultValue: 
"Send",
@@ -26,6 +27,7 @@ struct SendRequestV: View {
                    recvA11y: requTitle,
                sendDisabled: sendDisabled,
                  sendAction: .SendAction,
+               recvDisabled: recvDisabled,
                  recvAction: .RequestAction)
     }
 }
diff --git a/TalerWallet1/Views/Actions/TwoRowButtons.swift 
b/TalerWallet1/Views/Actions/TwoRowButtons.swift
index de19edb..3506d1d 100644
--- a/TalerWallet1/Views/Actions/TwoRowButtons.swift
+++ b/TalerWallet1/Views/Actions/TwoRowButtons.swift
@@ -105,8 +105,9 @@ struct TwoRowButtons: View {
     let recvTitle: String
     var recvType: TransactionType
     let recvA11y: String
-    let sendDisabled: Bool
+    let sendDisabled: Bool   // can't send/deposit if wallet has no coins at 
all
     let sendAction: NSNotification.Name
+    let recvDisabled: Bool   // can't receive/withdraw if wallet has no 
payments services
     let recvAction: NSNotification.Name
 
     func sendButton(_ title: String) -> TypeButton {
@@ -123,7 +124,7 @@ struct TwoRowButtons: View {
                    title: title,
                     a11y: recvA11y,
                     type: recvType,
-                disabled: false,
+                disabled: recvDisabled,
                   action: recvAction)
     }
 
@@ -163,6 +164,7 @@ struct TwoRowButtons_Previews: PreviewProvider {
                        recvA11y: "Request " + LONGCURRENCY,
                    sendDisabled: true,
                      sendAction: .SendAction,
+                   recvDisabled: false,
                      recvAction: .RequestAction)
                 .listRowSeparator(.hidden)
             TwoRowButtons(stack: CallStack("Preview"),
@@ -174,6 +176,7 @@ struct TwoRowButtons_Previews: PreviewProvider {
                        recvA11y: "Request " + DEMOCURRENCY,
                    sendDisabled: true,
                      sendAction: .SendAction,
+                   recvDisabled: false,
                      recvAction: .RequestAction)
                 .listRowSeparator(.hidden)
         }

-- 
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]