commit a82516fb84edce2241d763b10d076f0adb54fe27
parent 49a7748c4717fe6d2578b11a1628ba20e39126a5
Author: Marc Stibane <marc@taler.net>
Date: Wed, 23 Jul 2025 04:26:06 +0200
Allow tag 0
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/TalerWallet1/Views/HelperViews/NavLink.swift b/TalerWallet1/Views/HelperViews/NavLink.swift
@@ -21,7 +21,7 @@ import SwiftUI
struct NavLink <Content : View> : View {
- let tag: Int
+ let tag: Int?
@Binding var selection: Int?
@Binding var isActive: Bool
let content: Content
@@ -41,14 +41,14 @@ struct NavLink <Content : View> : View {
_ selection: Binding<Int?> = .constant(nil),
@ViewBuilder contentBuilder: () -> Content
) {
- self.tag = 0
+ self.tag = nil
self._selection = selection
self.content = contentBuilder()
self._isActive = isActive
}
var body: some View {
- if tag != 0 { // actions: $tabBarModel.actionSelected will hide the tabBar
+ if let tag { // actions: $tabBarModel.actionSelected will hide the tabBar
NavigationLink(destination: content, tag: tag, selection: $selection)
{ EmptyView() }.frame(width: 0).opacity(0).hidden()
} else { // shortcuts, AddButton