diff --git a/CHANGELOG.md b/CHANGELOG.md index e3138711f91..d401e6ae25a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed * Shadows in checkout * add text info to SupervisorView #APPS-1181 +* Kassenbonvorschau zeigt keinen "Fertig"-Button in der Navigation an #APPS-1159 ### Updated * datatrans/ios-sdk 3.4.0 (was 2.7.2) diff --git a/Example/Snabble/DashboardViewController.swift b/Example/Snabble/DashboardViewController.swift index 03d2cfd7b02..c0571d2e139 100644 --- a/Example/Snabble/DashboardViewController.swift +++ b/Example/Snabble/DashboardViewController.swift @@ -40,16 +40,17 @@ extension DashboardViewController: DynamicViewControllerDelegate { case .allStores: tabBarController?.selectedIndex = 2 case .lastPurchases: + var rootViewController: UIViewController? if let action = userInfo?["action"] as? String, action == "more" { - let viewController = ReceiptsListViewController() - viewController.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(dismiss(_:))) - let navigationController = UINavigationController(rootViewController: viewController) - present(navigationController, animated: true) + rootViewController = ReceiptsListViewController() } else if let action = userInfo?["action"] as? String, action == "purchase", let orderID = userInfo?["id"] as? String, let projectID = (widget as? WidgetLastPurchases)?.projectId { - - let detailViewController = ReceiptsDetailViewController(orderId: orderID, projectId: projectID) - present(detailViewController, animated: true) + rootViewController = ReceiptsDetailViewController(orderId: orderID, projectId: projectID) + } + rootViewController?.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(dismiss(_:))) + if let rootViewController { + let navigationController = UINavigationController(rootViewController: rootViewController) + present(navigationController, animated: true) } default: break diff --git a/Sources/UI/Receipts/ReceiptsDetailViewController.swift b/Sources/UI/Receipts/ReceiptsDetailViewController.swift index 4ee7010be0a..7b3fb3d7695 100644 --- a/Sources/UI/Receipts/ReceiptsDetailViewController.swift +++ b/Sources/UI/Receipts/ReceiptsDetailViewController.swift @@ -201,8 +201,6 @@ extension ReceiptsDetailViewController { target: self, action: #selector(rightBarButtonItemTouchedUpInside(_:))) navigationItem.rightBarButtonItem = barbuttonItem - } else { - navigationItem.rightBarButtonItem = nil } } }