Skip to content

Commit bc580c3

Browse files
Dependency inject customHelpCenterURL from source tag into HelpAndSupportViewController
1 parent 40edeb6 commit bc580c3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

WooCommerce/Classes/Authentication/AuthenticationManager.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,14 @@ extension AuthenticationManager: WordPressAuthenticatorDelegate {
380380
///
381381
func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag) {
382382
let identifier = HelpAndSupportViewController.classNameWithoutNamespaces
383-
guard let supportViewController = UIStoryboard.dashboard.instantiateViewController(withIdentifier: identifier) as? HelpAndSupportViewController else {
384-
return
385-
}
383+
let supportViewController = UIStoryboard.dashboard.instantiateViewController(identifier: identifier,
384+
creator: { coder -> HelpAndSupportViewController? in
385+
guard let customURL = sourceTag.customHelpCenterURL else {
386+
return nil
387+
}
386388

389+
return HelpAndSupportViewController(customHelpCenterURL: customURL, coder: coder)
390+
})
387391
supportViewController.displaysDismissAction = true
388392

389393
let navController = WooNavigationController(rootViewController: supportViewController)

0 commit comments

Comments
 (0)