-
Notifications
You must be signed in to change notification settings - Fork 0
home‐assistant Reconnect
Roffild edited this page Mar 26, 2024
·
1 revision
bug.mp4
build MinimalDebug
alert.setMessage(commonR.string.webview_error)
alert.setPositiveButton(commonR.string.settings) { _, _ ->
startActivity(SettingsActivity.newInstance(this))
// NO webView.loadUrl()
}
val isInternal = serverManager.getServer(presenter.getActiveServer())?.connection?.isInternal() == true
alert.setNegativeButton(
if (failedConnection == "external" && isInternal) {
commonR.string.refresh_internal
} else {
commonR.string.refresh_external
}
) { _, _ ->
runBlocking {
failedConnection = if (failedConnection == "external") {
serverManager.getServer(presenter.getActiveServer())?.let { webView.loadUrl(it.connection.getUrl(true).toString()) }
"internal"
} else {
serverManager.getServer(presenter.getActiveServer())?.let { webView.loadUrl(it.connection.getUrl(false).toString()) }
"external"
}
// webView.loadUrl() reloads the page!
}
waitForConnection() // FAKE! Only checks variables...
}
alert.setNeutralButton(commonR.string.wait) { _, _ ->
waitForConnection() // FAKE! Only checks variables...
// NO webView.loadUrl()
}