File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed
app/src/main/kotlin/io/homeassistant/companion/android/webview Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -1705,18 +1705,22 @@ class WebViewActivity :
17051705 }
17061706
17071707 private fun waitForConnection () {
1708- Handler (Looper .getMainLooper()).postDelayed(
1709- {
1710- if (
1711- ! isConnected &&
1712- ! loadedUrl.toHttpUrl().pathSegments.first().contains(" api" ) &&
1713- ! loadedUrl.toHttpUrl().pathSegments.first().contains(" local" )
1714- ) {
1715- showError(errorType = ErrorType .TIMEOUT_EXTERNAL_BUS )
1716- }
1717- },
1718- CONNECTION_DELAY ,
1719- )
1708+ if (supportFragmentManager.backStackEntryCount > 0 ) {
1709+ Timber .i(" Fragments ${supportFragmentManager.fragments} displayed, skipping connection wait" )
1710+ } else {
1711+ Handler (Looper .getMainLooper()).postDelayed(
1712+ {
1713+ if (
1714+ ! isConnected &&
1715+ ! loadedUrl.toHttpUrl().pathSegments.first().contains(" api" ) &&
1716+ ! loadedUrl.toHttpUrl().pathSegments.first().contains(" local" )
1717+ ) {
1718+ showError(errorType = ErrorType .TIMEOUT_EXTERNAL_BUS )
1719+ }
1720+ },
1721+ CONNECTION_DELAY ,
1722+ )
1723+ }
17201724 }
17211725
17221726 override fun sendExternalBusMessage (message : ExternalBusMessage ) {
You can’t perform that action at this time.
0 commit comments