소스 검색

Fix variable name in `isOnline` (#5991)

FourTOne5 3 년 전
부모
커밋
2196dac63e
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      app/src/main/java/eu/kanade/tachiyomi/util/system/ContextExtensions.kt

+ 3 - 3
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)
 }
 
 /**