commit de0957cc8ddd88043264931835577339f4d20b73
parent 61e680e4fc8de0195b82c68206fe8646037959da
Author: Marc Stibane <marc@taler.net>
Date: Fri, 12 Jul 2024 23:31:13 +0200
hints for P2P expiration
Diffstat:
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/TalerWallet1/Views/HelperViews/SelectDays.swift b/TalerWallet1/Views/HelperViews/SelectDays.swift
@@ -9,6 +9,7 @@ import SymLog
struct SelectDays: View {
private let symLog = SymLogV(0)
@Environment(\.isEnabled) private var isEnabled: Bool
+ @AppStorage("minimalistic") var minimalistic: Bool = false
#if DEBUG
@AppStorage("developerMode") var developerMode: Bool = true
#else
@@ -17,6 +18,7 @@ struct SelectDays: View {
@Binding var selected: UInt
let maxExpiration: UInt
+ let outgoing: Bool
func oneDayAction() -> Void {
selected = ONEDAY
@@ -74,6 +76,11 @@ struct SelectDays: View {
.accessibilityAddTraits(selected == THIRTYDAYS ? .isSelected : [])
.disabled(!isEnabled || maxExpiration < THIRTYDAYS)
} // 3 buttons
+ if !minimalistic {
+ Text(outgoing ? "The exchange will send your money back if it won't get collected in time, or when you abort the operation."
+ : "This request will be cancelled if it doesn't get paid in time, or when you abort the operation.")
+ .talerFont(.body)
+ }
}
}
}
@@ -82,7 +89,7 @@ struct SelectDays: View {
struct SelectDays_Previews: PreviewProvider {
static var previews: some View {
@State var expireDays: UInt = 1
- SelectDays(selected: $expireDays, maxExpiration: 20)
+ SelectDays(selected: $expireDays, maxExpiration: 20, outgoing: false)
}
}
#endif
diff --git a/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift b/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift
@@ -103,7 +103,7 @@ struct P2PSubjectV: View {
.accessibilityValue(String(localized: "\(summary.count) characters of 100"))
// TODO: compute max Expiration day from peerPushCheck to disable 30 (and even 7)
- SelectDays(selected: $expireDays, maxExpiration: THIRTYDAYS)
+ SelectDays(selected: $expireDays, maxExpiration: THIRTYDAYS, outgoing: amountToSend)
.disabled(false)
.padding(.bottom)