File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
WooCommerce/Classes/ViewRelated/Dashboard/MyStore Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,12 @@ extension PeriodDataViewController {
145145
146146extension PeriodDataViewController {
147147
148+ /// Indicates if the receiver has Remote Stats, or not.
149+ ///
150+ var shouldDisplayGhostContent : Bool {
151+ return orderStats == nil
152+ }
153+
148154 /// Displays the Placeholder Period Graph + Starts the Animation.
149155 /// Why is this public? Because the actual Sync OP is handled by StoreStatsViewController. We coordinate multiple
150156 /// placeholder animations from that spot!
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ extension StoreStatsViewController {
6969 func syncAllStats( onCompletion: ( ( ) -> Void ) ? = nil ) {
7070 let group = DispatchGroup ( )
7171
72- displayGhostContent ( )
72+ ensureGhostContentIsDisplayed ( )
7373
7474 periodVCs. forEach { ( vc) in
7575 group. enter ( )
@@ -97,6 +97,16 @@ extension StoreStatsViewController {
9797//
9898private extension StoreStatsViewController {
9999
100+ /// Displays the Ghost Placeholder whenever there is no visible data.
101+ ///
102+ func ensureGhostContentIsDisplayed( ) {
103+ guard visibleChildViewController. shouldDisplayGhostContent else {
104+ return
105+ }
106+
107+ displayGhostContent ( )
108+ }
109+
100110 /// Locks UI Interaction and displays Ghost Placeholder animations.
101111 ///
102112 func displayGhostContent( ) {
You can’t perform that action at this time.
0 commit comments