From 3aa6934f86d3082d5176ac0ff3d124d81dbbb0c8 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Sat, 20 Aug 2022 12:17:15 +0200 Subject: [PATCH] Don't create the mercury api if not connection is available --- .../readerforselfossv2/android/fragments/ArticleFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt index 17c441e..abc8f2c 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt @@ -275,10 +275,10 @@ class ArticleFragment : Fragment(), DIAware { } private fun getContentFromMercury(customTabsIntent: CustomTabsIntent) { + if (repository.isNetworkAvailable()) { binding.progressBar.visibility = View.VISIBLE val parser = MercuryApi() - if (repository.isNetworkAvailable()) { parser.parseUrl(url).enqueue( object : Callback { override fun onResponse(