Skip to content

Commit 520af77

Browse files
Create CustomHelpCenterContent using step and flow and inject into HelpAndSupportViewController.
1 parent 9b1340b commit 520af77

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

WooCommerce/Classes/Authentication/AuthenticationManager.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,20 +376,23 @@ extension AuthenticationManager: WordPressAuthenticatorDelegate {
376376
}
377377
}
378378

379+
func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag) {
380+
}
381+
379382
/// Presents the Support Interface from a given ViewController, with a specified SourceTag.
380383
///
381-
func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag) {
384+
func presentSupport(from sourceViewController: UIViewController, sourceTag: WordPressSupportSourceTag, lastStep: String, lastFlow: String) {
382385
let identifier = HelpAndSupportViewController.classNameWithoutNamespaces
383386
let supportViewController = UIStoryboard.dashboard.instantiateViewController(identifier: identifier,
384387
creator: { coder -> HelpAndSupportViewController? in
385-
guard let customURL = sourceTag.customHelpCenterURL else {
388+
guard let customHelpCenterContent = CustomHelpCenterContent(step: lastStep, flow: lastFlow) else {
386389
/// Returning nil as we don't need to customise the HelpAndSupportViewController
387390
/// In this case `instantiateViewController` method will use the default `HelpAndSupportViewController` created from storyboard.
388391
///
389392
return nil
390393
}
391394

392-
return HelpAndSupportViewController(customHelpCenterURL: customURL, coder: coder)
395+
return HelpAndSupportViewController(customHelpCenterContent: customHelpCenterContent, coder: coder)
393396
})
394397
supportViewController.displaysDismissAction = true
395398

0 commit comments

Comments
 (0)