Don't create the mercury api if not connection is available

This commit is contained in:
davidoskky 2022-08-20 12:17:15 +02:00
parent 9a33ba0dbb
commit 59267e6759

View File

@ -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<ParsedContent> {
override fun onResponse(