From 2196dac63e6b53716e80901e41671d094ed8d784 Mon Sep 17 00:00:00 2001 From: FourTOne5 <59261191+FourTOne5@users.noreply.github.com> Date: Fri, 1 Oct 2021 18:09:46 +0600 Subject: [PATCH] Fix variable name in `isOnline` (#5991) --- .../eu/kanade/tachiyomi/util/system/ContextExtensions.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt index 8e2e6d86e..65e7589b5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt @@ -369,14 +369,14 @@ fun Context.createReaderThemeContext(): Context { } fun Context.isOnline(): Boolean { - val networkCapabilities = connectivityManager.activeNetwork ?: return false - val actNw = connectivityManager.getNetworkCapabilities(networkCapabilities) ?: return false + val activeNetwork = connectivityManager.activeNetwork ?: return false + val networkCapabilities = connectivityManager.getNetworkCapabilities(activeNetwork) ?: return false val maxTransport = when { Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 -> NetworkCapabilities.TRANSPORT_LOWPAN Build.VERSION.SDK_INT >= Build.VERSION_CODES.O -> NetworkCapabilities.TRANSPORT_WIFI_AWARE else -> NetworkCapabilities.TRANSPORT_VPN } - return (NetworkCapabilities.TRANSPORT_CELLULAR..maxTransport).any(actNw::hasTransport) + return (NetworkCapabilities.TRANSPORT_CELLULAR..maxTransport).any(networkCapabilities::hasTransport) } /**