Skip to content

Commit ab595d1

Browse files
committed
Restart ghost animation in order list viewWillAppear to resume animation.
1 parent 5c909ec commit ab595d1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

WooCommerce/Classes/ViewRelated/Orders/OrderListViewController.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ final class OrderListViewController: UIViewController {
158158
//
159159
// We can remove this once we've replaced XLPagerTabStrip.
160160
tableView.reloadData()
161+
162+
restartPlaceholderAnimation()
161163
}
162164

163165
/// Returns a function that creates cells for `dataSource`.
@@ -423,6 +425,14 @@ private extension OrderListViewController {
423425
ghostableTableView.removeGhostContent()
424426
}
425427

428+
/// After returning to the screen, `restartGhostAnimation` is required to resume ghost animation.
429+
func restartPlaceholderAnimation() {
430+
guard ghostableTableView.isHidden == false else {
431+
return
432+
}
433+
ghostableTableView.restartGhostAnimation(style: Constants.ghostStyle)
434+
}
435+
426436
/// Shows the EmptyStateViewController
427437
///
428438
func displayEmptyViewController() {
@@ -675,4 +685,8 @@ private extension OrderListViewController {
675685
case results
676686
case empty
677687
}
688+
689+
enum Constants {
690+
static let ghostStyle: GhostStyle = .wooDefaultGhostStyle
691+
}
678692
}

0 commit comments

Comments
 (0)