File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
WooCommerce/Classes/Authentication/Epilogue Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 11import SwiftUI
2+ import SafariServices
23
34/// Hosting controller wrapper for `StorePickerError`
45///
56final class StorePickerErrorHostingController : UIHostingController < StorePickerError > {
7+
8+ /// Creates an `StorePickerErrorHostingController` with preconfigured button actions.
9+ ///
10+ static func createWithActions( presentingViewController: UIViewController ) -> StorePickerErrorHostingController {
11+ . init(
12+ troubleshootingAction: {
13+ let safariViewController = SFSafariViewController ( url: WooConstants . URLs. troubleshootErrorLoadingData. asURL ( ) )
14+ presentingViewController. present ( safariViewController, animated: true )
15+ } ,
16+ contactSupportAction: {
17+ ZendeskManager . shared. showNewRequestIfPossible ( from: presentingViewController)
18+ } ,
19+ dismissAction: {
20+ presentingViewController. dismiss ( animated: true )
21+ }
22+ )
23+ }
24+
625 init ( troubleshootingAction: @escaping ( ) -> Void , contactSupportAction: @escaping ( ) -> Void , dismissAction: @escaping ( ) -> Void ) {
726 super. init ( rootView: StorePickerError ( troubleshootingAction: troubleshootingAction,
827 contactSupportAction: contactSupportAction,
You can’t perform that action at this time.
0 commit comments