commit b5c702e033b0e63718dabac710f98aeaf9809894
parent 0a202c0b93b14247852add3bdc032afb370076d8
Author: Marc Stibane <marc@taler.net>
Date: Sun, 15 Jun 2025 10:19:53 +0200
prepare #9007 fix
Diffstat:
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/TalerWallet1/Views/Main/MainView.swift b/TalerWallet1/Views/Main/MainView.swift
@@ -44,6 +44,7 @@ struct MainView: View {
@State private var qrButton2Tapped = false
@State private var innerHeight: CGFloat = .zero
@State private var userAction = 0
+ @State private var networkUnavailable = false
func sheetDismissed() -> Void {
logger.info("sheet dismiss")
@@ -149,7 +150,22 @@ struct MainView: View {
}
}.animation(.linear(duration: LAUNCHDURATION), value: controller.backendState)
- Group {
+ VStack {
+#if DEBUG
+ if networkUnavailable {
+ RoundedRectangle(cornerRadius: 15)
+ .fill(Color.red)
+ .frame(
+ width: UIScreen.screenWidth * 0.9,
+ height: 100
+ )
+ .transition(.asymmetric(
+ insertion: .move(edge: .top),
+ removal: .move(edge: .top)
+ ))
+
+ }
+#endif
mainGroup
.environmentObject(tabBarModel)
// .animation(.default, value: model.error2 == nil)
@@ -234,6 +250,17 @@ struct MainView: View {
withAnimation(Animation.easeOut(duration: 0.5).delay(delay)) {
showScanner = true // switch to qrSheet => camera on
} } }
+ .onChange(of: controller.isConnected) { isConnected in
+ if isConnected {
+ withAnimation(Animation.easeIn(duration: 1.0)) {
+ networkUnavailable = false
+ }
+ } else {
+ withAnimation(Animation.easeOut(duration: 1.0)) {
+ networkUnavailable = true
+ }
+ }
+ }
} // body
}
// MARK: - TabBar