diff --git a/WordPress/Classes/ViewRelated/Stats/StatsViewController.m b/WordPress/Classes/ViewRelated/Stats/StatsViewController.m index 02e826c025de..85cbf6c89c22 100644 --- a/WordPress/Classes/ViewRelated/Stats/StatsViewController.m +++ b/WordPress/Classes/ViewRelated/Stats/StatsViewController.m @@ -99,15 +99,17 @@ - (void) installWidgetsButton - (void)initStats { - if (!self.isActivatingStatsModule && ![self.blog isStatsActive]) { - [self showStatsModuleDisabled]; - return; - } - SiteStatsInformation.sharedInstance.siteTimeZone = [self.blog timeZone]; // WordPress.com + Jetpack REST if (self.blog.account) { + + // Prompt user to enable site stats if stats module is disabled + if (!self.isActivatingStatsModule && ![self.blog isStatsActive]) { + [self showStatsModuleDisabled]; + return; + } + SiteStatsInformation.sharedInstance.oauth2Token = self.blog.account.authToken; SiteStatsInformation.sharedInstance.siteID = self.blog.dotComID; @@ -115,6 +117,7 @@ - (void)initStats [self initializeStatsWidgetsIfNeeded]; return; } + [self refreshStatus]; }