From e711e5fe043da1147205bb35df06f3151b7647f7 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 16 May 2022 13:17:27 +0530 Subject: [PATCH] build fix : ktlintFormat --- .../e/apps/MainActivityViewModel.kt | 2 +- .../signin/LocaleChangedBroadcastReceiver.kt | 24 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt b/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt index d3023bd80..14ca337f5 100644 --- a/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt +++ b/app/src/main/java/foundation/e/apps/MainActivityViewModel.kt @@ -140,7 +140,7 @@ class MainActivityViewModel @Inject constructor( /* * Set retry button. */ - setButton(DialogInterface.BUTTON_POSITIVE, activity.getString(R.string.retry)) {_, _ -> + setButton(DialogInterface.BUTTON_POSITIVE, activity.getString(R.string.retry)) { _, _ -> positiveButtonBlock() } /* diff --git a/app/src/main/java/foundation/e/apps/setup/signin/LocaleChangedBroadcastReceiver.kt b/app/src/main/java/foundation/e/apps/setup/signin/LocaleChangedBroadcastReceiver.kt index 0c3239a35..8865e5263 100644 --- a/app/src/main/java/foundation/e/apps/setup/signin/LocaleChangedBroadcastReceiver.kt +++ b/app/src/main/java/foundation/e/apps/setup/signin/LocaleChangedBroadcastReceiver.kt @@ -25,7 +25,6 @@ import android.util.Log import com.aurora.gplayapi.data.models.AuthData import com.google.gson.Gson import dagger.hilt.android.AndroidEntryPoint -import foundation.e.apps.MainActivity import foundation.e.apps.utils.modules.DataStoreModule import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers @@ -50,18 +49,17 @@ class LocaleChangedBroadcastReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { GlobalScope.launch { - try{ - val authDataJson = dataStoreModule.getAuthDataSync() - val authData = gson.fromJson(authDataJson, AuthData::class.java) - authData.locale = context.resources.configuration.locales[0] - dataStoreModule.saveCredentials(authData) - withContext(Dispatchers.IO) { - cache.evictAll() - } - }catch (ex :Exception){ - Log.e(TAG, ex.message.toString()) - } - + try { + val authDataJson = dataStoreModule.getAuthDataSync() + val authData = gson.fromJson(authDataJson, AuthData::class.java) + authData.locale = context.resources.configuration.locales[0] + dataStoreModule.saveCredentials(authData) + withContext(Dispatchers.IO) { + cache.evictAll() + } + } catch (ex: Exception) { + Log.e(TAG, ex.message.toString()) + } } } } -- GitLab