From e60ed92c6d69457bb42a8c3c6516f1caae0dec58 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Thu, 18 Aug 2022 14:50:19 +0200 Subject: [PATCH] Do not change the network override from within the repository --- .../bou/amine/apps/readerforselfossv2/android/HomeActivity.kt | 1 + .../amine/apps/readerforselfossv2/repository/RepositoryImpl.kt | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/HomeActivity.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/HomeActivity.kt index 2cb4e70..e92b4ab 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/HomeActivity.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/HomeActivity.kt @@ -1024,6 +1024,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar Toast.makeText(this, R.string.refresh_in_progress, Toast.LENGTH_SHORT).show() // TODO: Use Dispatchers.IO CoroutineScope(Dispatchers.Main).launch { + repository.offlineOverride = false val updatedRemote = repository.updateRemote() if (updatedRemote) { // TODO: Send toast messages from the repository diff --git a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryImpl.kt b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryImpl.kt index 078e206..f0f7839 100644 --- a/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryImpl.kt +++ b/shared/src/commonMain/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryImpl.kt @@ -333,7 +333,6 @@ class Repository(private val api: SelfossApi, private val apiDetails: ApiDetails suspend fun updateRemote(): Boolean { var response = false - offlineOverride = false if (isConnectionAvailable.value) { response = api.update()?.isSuccess == true }