AuthViewModel: Fix issue with google play version code being -1
* Migrate existing users to default version code if they have -1 set * Also add issue IDs infront of migrations if available Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import com.aurora.store.util.Preferences.PREFERENCE_DISPENSER_URLS
|
||||
import com.aurora.store.util.Preferences.PREFERENCE_INTRO
|
||||
import com.aurora.store.util.Preferences.PREFERENCE_MIGRATION_VERSION
|
||||
import com.aurora.store.util.Preferences.PREFERENCE_THEME_ACCENT
|
||||
import com.aurora.store.util.Preferences.PREFERENCE_VENDING_VERSION
|
||||
import com.aurora.store.util.save
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@@ -43,9 +44,12 @@ class MigrationReceiver: BroadcastReceiver() {
|
||||
|
||||
// 58 -> 59
|
||||
if (currentVersion == 0) {
|
||||
CacheWorker.scheduleAutomatedCacheCleanup(context)
|
||||
CacheWorker.scheduleAutomatedCacheCleanup(context) // !1089
|
||||
if (isSAndAbove()) context.save(PREFERENCE_THEME_ACCENT, 0)
|
||||
context.save(PREFERENCE_DISPENSER_URLS, setOf(Constants.URL_DISPENSER))
|
||||
context.save(PREFERENCE_DISPENSER_URLS, setOf(Constants.URL_DISPENSER)) // !1117
|
||||
if (Preferences.getInteger(context, PREFERENCE_VENDING_VERSION) == -1) {
|
||||
context.save(PREFERENCE_VENDING_VERSION, 0) // !1049
|
||||
}
|
||||
currentVersion++
|
||||
}
|
||||
|
||||
|
||||
@@ -290,9 +290,8 @@ class AuthViewModel @Inject constructor(
|
||||
authData.locale = Locale.getDefault()
|
||||
}
|
||||
|
||||
val versionId =
|
||||
Preferences.getInteger(context, Preferences.PREFERENCE_VENDING_VERSION)
|
||||
if (versionId != 0) {
|
||||
val versionId = Preferences.getInteger(context, Preferences.PREFERENCE_VENDING_VERSION)
|
||||
if (versionId > 0) {
|
||||
val resources = context.resources
|
||||
|
||||
authData.deviceInfoProvider?.properties?.let {
|
||||
|
||||
Reference in New Issue
Block a user