From 8c3609d88e92f04ea998c66d0a6d292251d1b43a Mon Sep 17 00:00:00 2001 From: Hasib Prince Date: Fri, 15 Apr 2022 16:06:44 +0600 Subject: [PATCH] fixed: app was not showing proper language --- .../main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt b/app/src/main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt index 4f3901c42..9f7ba54d1 100644 --- a/app/src/main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt +++ b/app/src/main/java/foundation/e/apps/api/gplay/GPlayAPIImpl.kt @@ -35,6 +35,7 @@ import foundation.e.apps.utils.modules.DataStoreModule import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async import kotlinx.coroutines.withContext +import java.util.Locale import javax.inject.Inject class GPlayAPIImpl @Inject constructor( @@ -46,7 +47,10 @@ class GPlayAPIImpl @Inject constructor( // TODO: DON'T HARDCODE DISPATCHERS IN ANY METHODS suspend fun fetchAuthData() = withContext(Dispatchers.IO) { val data = async { tokenRepository.getAuthData() } - data.await()?.let { dataStoreModule.saveCredentials(it) } + data.await()?.let { + it.locale = Locale.getDefault() // update locale with the default locale from settings + dataStoreModule.saveCredentials(it) + } } fun fetchAuthData(email: String, aasToken: String): AuthData { -- GitLab