From a7d56603e516a32582d687293dd8de9f80a2b4a8 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 7 Sep 2020 03:42:38 +0200 Subject: [PATCH] Fixed bug that NavigationLink navigated to AccountTransactionsDialog twice --- .../BankingiOSApp/ui/views/AllBanksListItem.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/AllBanksListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/AllBanksListItem.swift index 6ef1799b..6b535ef0 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/AllBanksListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/AllBanksListItem.swift @@ -6,17 +6,24 @@ struct AllBanksListItem: View { let banks: [Customer] + @State private var navigateToAccountTransactionsDialog = false + var body: some View { Section { - NavigationLink(destination: LazyView(AccountTransactionsDialog(allBanks: self.banks))) { + NavigationLink(destination: EmptyView(), isActive: .constant(false)) { // NavigationLink navigated to AccountTransactionsDialog twice. So i disabled NavigationLink and implemented manual navigation HStack { IconedTitleView(accountTitle: "All accounts".localize(), iconUrl: nil, defaultIconName: Styles.AccountFallbackIcon, titleFont: .headline) Spacer() AmountLabel(amount: banks.sumBalances()) - }.frame(height: 35) + } + .frame(height: 35) + .background(Color.systemBackground) // make background tapable + } + .onTapGesture { + SceneDelegate.navigateToView(AccountTransactionsDialog(allBanks: self.banks)) } } }