Skip to content

Commit c494481

Browse files
author
Momo Ozawa
committed
Refactor: only scroll if necessary
Previously, scrollToElement was being called for the noSuchElement QuickStart element
1 parent ae358a7 commit c494481

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController+FancyAlerts.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ extension BlogDetailsViewController {
1616
self?.refreshSiteIcon()
1717
self?.configureTableViewData()
1818
self?.reloadTableViewPreservingSelection()
19-
if let element = QuickStartTourElement(rawValue: QuickStartTourGuide.shared.currentElementInt()) {
20-
self?.scroll(to: element)
21-
}
2219

2320
if let info = notification.userInfo?[QuickStartTourGuide.notificationElementKey] as? QuickStartTourElement {
2421
switch info {
@@ -33,7 +30,11 @@ extension BlogDetailsViewController {
3330
case .siteIcon, .siteTitle:
3431
// handles the padding in case the element is not in the table view
3532
self?.additionalSafeAreaInsets = UIEdgeInsets(top: 0, left: 0, bottom: BlogDetailsViewController.bottomPaddingForQuickStartNotices, right: 0)
33+
case .pages, .editHomepage, .sharing, .stats:
34+
self?.scroll(to: info)
3635
case .viewSite:
36+
self?.scroll(to: info)
37+
3738
guard let self = self,
3839
let navigationController = self.navigationController,
3940
navigationController.visibleViewController != self else {

0 commit comments

Comments
 (0)