From 394943fead0144ec21a52c3fedde0129847e6ba2 Mon Sep 17 00:00:00 2001 From: Nick Bradbury Date: Tue, 17 Dec 2024 16:01:18 -0500 Subject: [PATCH] Remove language pref during migration --- .../java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt | 4 ++-- .../java/org/wordpress/android/util/PerAppLocaleManager.kt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt index 2300c40b1437..4c0e962cc801 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefsWrapper.kt @@ -460,8 +460,8 @@ class AppPrefsWrapper @Inject constructor(val buildConfigWrapper: BuildConfigWra return AppPrefs.prefs().getString(key, defValue) } - fun setPrefString(key: String, value: String) { - AppPrefs.prefs().edit().putString(key, value).apply() + fun removePref(key: String) { + AppPrefs.prefs().edit().remove(key).apply() } fun getDebugBooleanPref(key: String, default: Boolean = false) = diff --git a/WordPress/src/main/java/org/wordpress/android/util/PerAppLocaleManager.kt b/WordPress/src/main/java/org/wordpress/android/util/PerAppLocaleManager.kt index 084cc65e1f09..f157a6d7e217 100644 --- a/WordPress/src/main/java/org/wordpress/android/util/PerAppLocaleManager.kt +++ b/WordPress/src/main/java/org/wordpress/android/util/PerAppLocaleManager.kt @@ -59,6 +59,7 @@ class PerAppLocaleManager @Inject constructor( "PerAppLocaleManager: performing migration to AndroidX per-app language prefs" ) setCurrentLocaleByLanguageCode(previousLanguage) + appPrefsWrapper.removePref(OLD_LOCALE_PREF_KEY_STRING) } else { appLogWrapper.d( AppLog.T.SETTINGS,