Skip to content

Commit 1676bb4

Browse files
Take url as parameter to launchCustomHelpCenterWebPage method.
1 parent 24c27cd commit 1676bb4

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Help/HelpAndSupportViewController.swift

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,11 @@ private extension HelpAndSupportViewController {
312312

313313
/// Opens custom help center URL in a web view
314314
///
315-
func launchCustomHelpCenterWebPage() {
316-
guard let customHelpCenterURL = customHelpCenterURL else {
317-
return
318-
}
319-
320-
WebviewHelper.launch(customHelpCenterURL, with: self)
315+
func launchCustomHelpCenterWebPage(url: URL) {
316+
WebviewHelper.launch(url, with: self)
321317

322318
ServiceLocator.analytics.track(.supportHelpCenterViewed,
323-
withProperties: ["help_content_url": customHelpCenterURL.absoluteString])
319+
withProperties: ["help_content_url": url.absoluteString])
324320
}
325321
}
326322

@@ -331,12 +327,11 @@ private extension HelpAndSupportViewController {
331327
/// Help Center action
332328
///
333329
func helpCenterWasPressed() {
334-
guard customHelpCenterURL == nil else {
335-
launchCustomHelpCenterWebPage()
336-
return
330+
if let customHelpCenterURL = customHelpCenterURL {
331+
launchCustomHelpCenterWebPage(url: customHelpCenterURL)
332+
} else {
333+
ZendeskProvider.shared.showHelpCenter(from: self)
337334
}
338-
339-
ZendeskProvider.shared.showHelpCenter(from: self)
340335
}
341336

342337
/// Contact Support action

0 commit comments

Comments
 (0)