From 9eb16c2beda2eef895f5c89e0e0af804a23c9bb2 Mon Sep 17 00:00:00 2001 From: Jay Newstrom Date: Fri, 3 Jan 2025 11:53:33 -0600 Subject: [PATCH] Fix country utils cache. (#9852) --- .../main/java/com/stripe/android/core/model/CountryUtils.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stripe-core/src/main/java/com/stripe/android/core/model/CountryUtils.kt b/stripe-core/src/main/java/com/stripe/android/core/model/CountryUtils.kt index fe087ea34e0..6b197073238 100644 --- a/stripe-core/src/main/java/com/stripe/android/core/model/CountryUtils.kt +++ b/stripe-core/src/main/java/com/stripe/android/core/model/CountryUtils.kt @@ -110,8 +110,6 @@ object CountryUtils { return if (currentLocale == cachedCountriesLocale) { cachedOrderedLocalizedCountries } else { - cachedCountriesLocale = currentLocale - val localizedCountries = localizedCountries(currentLocale) cachedOrderedLocalizedCountries = listOfNotNull( localizedCountries.firstOrNull { @@ -123,6 +121,8 @@ object CountryUtils { .sortedBy { formatNameForSorting(it.name) } ) + cachedCountriesLocale = currentLocale + cachedOrderedLocalizedCountries } }