File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
WooCommerce/Classes/ViewRelated/Orders Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ class OrdersViewController: UIViewController {
5454 override func viewDidAppear( _ animated: Bool ) {
5555 super. viewDidAppear ( animated)
5656 if orders. isEmpty {
57+ ensureRefreshControlIsVisible ( )
5758 syncOrders ( )
5859 }
5960 }
@@ -164,10 +165,6 @@ private extension OrdersViewController {
164165 self ? . tableView. reloadData ( )
165166 }
166167
167- if refreshControl. isRefreshing {
168- refreshControl. endRefreshing ( )
169- }
170- refreshControl. beginRefreshing ( )
171168 StoresManager . shared. dispatch ( action)
172169 }
173170
@@ -176,6 +173,17 @@ private extension OrdersViewController {
176173 isUsingFilterAction = false
177174 tableView. reloadData ( )
178175 }
176+
177+
178+ func ensureRefreshControlIsVisible( ) {
179+ guard tableView. contentOffset. y == 0 else {
180+ return
181+ }
182+
183+ let point = CGPoint ( x: 0 , y: - refreshControl. frame. height)
184+ tableView. setContentOffset ( point, animated: true )
185+ refreshControl. beginRefreshing ( )
186+ }
179187}
180188
181189
You can’t perform that action at this time.
0 commit comments