From bc9439493753e544672725a508e45669c10056cc Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 27 Sep 2020 23:01:23 +0200 Subject: [PATCH] Fixed that ContextMenu items didn't work anymore on iOS 14 --- .../views/listitems/AccountTransactionListItem.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/listitems/AccountTransactionListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/listitems/AccountTransactionListItem.swift index ae304fc9..237fb835 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/listitems/AccountTransactionListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/listitems/AccountTransactionListItem.swift @@ -53,7 +53,7 @@ struct AccountTransactionListItem: View { } .contextMenu { if transaction.canCreateMoneyTransferFrom { - NavigationLink(destination: LazyView(TransferMoneyDialog(preselectedValues: TransferMoneyData.Companion().fromAccountTransactionWithoutAmountAndReference(transaction: self.transaction)))) { + Button(action: { self.navigateToTransferMoneyDialog(TransferMoneyData.Companion().fromAccountTransactionWithoutAmountAndReference(transaction: self.transaction)) }) { HStack { Text("Transfer money to \(transaction.otherPartyName ?? "")") @@ -61,7 +61,7 @@ struct AccountTransactionListItem: View { } } - NavigationLink(destination: LazyView(TransferMoneyDialog(preselectedValues: TransferMoneyData.Companion().fromAccountTransaction(transaction: self.transaction)))) { + Button(action: { self.navigateToTransferMoneyDialog(TransferMoneyData.Companion().fromAccountTransaction(transaction: self.transaction)) }) { HStack { Text("New transfer with same data") @@ -70,6 +70,9 @@ struct AccountTransactionListItem: View { } } } + .onTapGesture { + SceneDelegate.navigateToView(AccountTransactionDetailsDialog(transaction)) + } } @@ -84,6 +87,10 @@ struct AccountTransactionListItem: View { return transaction.bookingText ?? "" } + + private func navigateToTransferMoneyDialog(_ preselectedValues: TransferMoneyData) { + SceneDelegate.navigateToView(TransferMoneyDialog(preselectedValues: preselectedValues)) + } }