From 6184a5c10a03ee4193d8fc97e3026fcc5acabd7f Mon Sep 17 00:00:00 2001 From: Povilas Staskus Date: Fri, 7 Oct 2022 17:34:12 +0300 Subject: [PATCH 1/2] Explicitly set insights as selected period when grow audience is showing When we simply return, we can get into cases where selectedPeriod is not equal to .insights even though insights are open. In such an instance the tab switching doesn't work anymore. --- .../Stats/SiteStatsDashboardViewController.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Stats/SiteStatsDashboardViewController.swift b/WordPress/Classes/ViewRelated/Stats/SiteStatsDashboardViewController.swift index 39936a702d9b..13770c892c93 100644 --- a/WordPress/Classes/ViewRelated/Stats/SiteStatsDashboardViewController.swift +++ b/WordPress/Classes/ViewRelated/Stats/SiteStatsDashboardViewController.swift @@ -198,12 +198,17 @@ private extension SiteStatsDashboardViewController { private extension SiteStatsDashboardViewController { func saveSelectedPeriodToUserDefaults() { - guard let siteID = SiteStatsInformation.sharedInstance.siteID?.intValue, - !insightsTableViewController.isGrowAudienceShowing else { + guard let siteID = SiteStatsInformation.sharedInstance.siteID?.intValue else { return } let key = Self.lastSelectedStatsPeriodTypeKey(forSiteID: siteID) + + guard !insightsTableViewController.isGrowAudienceShowing else { + UserPersistentStoreFactory.instance().set(StatsPeriodType.insights.rawValue, forKey: key) + return + } + UserPersistentStoreFactory.instance().set(currentSelectedPeriod.rawValue, forKey: key) } From 25f69c9346fadbf2abda4f071f319d8b1f35cbea Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 6 Oct 2022 17:58:00 +1100 Subject: [PATCH 2/2] Update expected Bundler to version 2.3.23 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 939ac56230d3..a02fde0861da 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -396,4 +396,4 @@ DEPENDENCIES xcpretty-travis-formatter BUNDLED WITH - 2.3.22 + 2.3.23