mirror of
https://github.com/home-assistant/android
synced 2024-07-22 10:54:12 +00:00
Skip showing connection prompt when loaded URL is local or api path (#3232)
* Skip showing connection prompt when loaded URL is local or api path * Only check first segment to limit false positives
This commit is contained in:
parent
346ef3da5f
commit
33fc6c3779
|
@ -109,6 +109,7 @@ import kotlinx.coroutines.launch
|
|||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.withContext
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import org.chromium.net.CronetEngine
|
||||
import org.json.JSONObject
|
||||
import java.util.concurrent.Executors
|
||||
|
@ -1321,7 +1322,11 @@ class WebViewActivity : BaseActivity(), io.homeassistant.companion.android.webvi
|
|||
private fun waitForConnection() {
|
||||
Handler(Looper.getMainLooper()).postDelayed(
|
||||
{
|
||||
if (!isConnected) {
|
||||
if (
|
||||
!isConnected &&
|
||||
!loadedUrl.toHttpUrl().pathSegments.first().contains("api") &&
|
||||
!loadedUrl.toHttpUrl().pathSegments.first().contains("local")
|
||||
) {
|
||||
showError()
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue