Skip to content

Commit

Permalink
Don't show other webview errors if HTTP auth is pending
Browse files Browse the repository at this point in the history
  • Loading branch information
jpelgrom committed Jan 5, 2025
1 parent fe94d30 commit fff9bbc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ class WebViewActivity : BaseActivity(), io.homeassistant.companion.android.webvi

if (!httpAuth?.host.isNullOrBlank()) {
if (!authError) {
handler.proceed(httpAuth?.username, httpAuth?.password)
handler.proceed(httpAuth.username, httpAuth.password)
autoAuth = true
firstAuthTime = System.currentTimeMillis()
}
Expand All @@ -1488,6 +1488,7 @@ class WebViewActivity : BaseActivity(), io.homeassistant.companion.android.webvi
}
}
if (!autoAuth || authError) {
isShowingError = true
AlertDialog.Builder(this, R.style.Authentication_Dialog)
.setTitle(commonR.string.auth_request)
.setMessage(message)
Expand Down Expand Up @@ -1528,6 +1529,10 @@ class WebViewActivity : BaseActivity(), io.homeassistant.companion.android.webvi
Toast.makeText(applicationContext, commonR.string.auth_cancel, Toast.LENGTH_SHORT)
.show()
}
.setOnDismissListener {
isShowingError = false
waitForConnection()
}
.show()
}
}
Expand Down

0 comments on commit fff9bbc

Please sign in to comment.