File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
WooCommerce/Classes/ViewRelated/Dashboard/Stats v4 Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -309,8 +309,9 @@ private extension StoreStatsV4PeriodViewController {
309309 timeRangeBarView. backgroundColor = . systemColor( . secondarySystemGroupedBackground)
310310 visitorsStackView. backgroundColor = . systemColor( . secondarySystemGroupedBackground)
311311
312- // Visitor empty view
313- visitorsStackView. insertArrangedSubview ( visitorsEmptyView, at: 2 )
312+ // Visitor empty view - insert it at the second-to-last index
313+ let emptyViewIndex = max ( 0 , visitorsStackView. arrangedSubviews. count - 2 )
314+ visitorsStackView. insertArrangedSubview ( visitorsEmptyView, at: emptyViewIndex)
314315 visitorsEmptyView. isHidden = true
315316
316317 // Time range bar bottom border view
@@ -449,10 +450,10 @@ extension StoreStatsV4PeriodViewController {
449450 func updateSiteVisitStats( mode: SiteVisitStatsMode ) {
450451 // Hides site visit stats for "today"
451452 guard timeRange != . today else {
452- visitorsStackView? . isHidden = true
453+ visitorsStackView. isHidden = true
453454 return
454455 }
455- visitorsStackView? . isHidden = ( mode == . hidden)
456+ visitorsStackView. isHidden = ( mode == . hidden)
456457 }
457458}
458459
You can’t perform that action at this time.
0 commit comments