From dd901c67909e11408348f28935bd010835d32e76 Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Fri, 6 May 2022 14:35:13 +0200 Subject: [PATCH] Fixed paid subscribers chart reloading when toggling fake data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://ghost.slack.com/archives/C02G9E68C/p1651773627838629?thread_ts=1651771893.729649&cid=C02G9E68C The chart was not reloading when the fake data toggle was changed. This code is only used when using mocked data. So if you loaded the page without mocked data, everything was working fine and the chart did show the right data. If you then enabled fake data, the chart just won’t reload and would keep showing the initial data (so it wasn’t always showing mocked data, just the initial data). --- ghost/admin/app/services/dashboard-stats.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ghost/admin/app/services/dashboard-stats.js b/ghost/admin/app/services/dashboard-stats.js index 156d53da0f..973575acbe 100644 --- a/ghost/admin/app/services/dashboard-stats.js +++ b/ghost/admin/app/services/dashboard-stats.js @@ -310,9 +310,6 @@ export default class DashboardStatsService extends Service { } loadSubscriptionCountStats() { - if (this.paidMembersByCadence && this.paidMembersByTier && this.subscriptionCountStats) { - return; - } if (this._loadSubscriptionCountStats.isRunning) { // We need to explicitly wait for the already running task instead of dropping it and returning immediately return this._loadSubscriptionCountStats.last; @@ -676,6 +673,7 @@ export default class DashboardStatsService extends Service { this.loadMrrStats(); this.loadMemberCountStats(); + this.loadSubscriptionCountStats(); this.loadLastSeen(); this.loadPaidMembersByCadence(); this.loadPaidMembersByTier();