Skip to content

Commit 65166f8

Browse files
committed
Add a comment based on CR feedback, and share the ghost style.
1 parent ee37699 commit 65166f8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Stats v4/StoreStatsV4PeriodViewController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ final class StoreStatsV4PeriodViewController: UIViewController {
158158

159159
override func viewWillAppear(_ animated: Bool) {
160160
super.viewWillAppear(animated)
161+
162+
// After returning to the My Store tab, `restartGhostAnimation` is required to resume ghost animation.
161163
restartGhostAnimationIfNeeded()
162164
}
163165

@@ -244,7 +246,7 @@ extension StoreStatsV4PeriodViewController {
244246
///
245247
func displayGhostContent() {
246248
ensurePlaceholderIsVisible()
247-
placeholderChartsView.startGhostAnimation(style: .wooDefaultGhostStyle)
249+
placeholderChartsView.startGhostAnimation(style: Constants.ghostStyle)
248250
}
249251

250252
/// Removes the Placeholder Content.
@@ -272,7 +274,7 @@ extension StoreStatsV4PeriodViewController {
272274
guard placeholderChartsView.superview != nil else {
273275
return
274276
}
275-
placeholderChartsView.restartGhostAnimation(style: .wooDefaultGhostStyle)
277+
placeholderChartsView.restartGhostAnimation(style: Constants.ghostStyle)
276278
}
277279
}
278280

@@ -753,5 +755,7 @@ private extension StoreStatsV4PeriodViewController {
753755

754756
static let containerBackgroundColor: UIColor = .systemBackground
755757
static let headerComponentBackgroundColor: UIColor = .clear
758+
759+
static let ghostStyle: GhostStyle = .wooDefaultGhostStyle
756760
}
757761
}

0 commit comments

Comments
 (0)