From 59267e67596d1cead3ca5e5242b54c4e61759078 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(