Check protocol/port when determining reload for WebView (#4297)

- When determining whether the WebView should be reloaded with the current server URL, also check that the protocol (http/https) and port (8123, 443, ...) match and if not reload.
This commit is contained in:
Joris Pelgröm 2024-03-26 23:14:28 +01:00 committed by GitHub
parent de3a3481e2
commit 5bf22b8631
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,7 +100,12 @@ class WebViewPresenterImpl @Inject constructor(
loosing wifi signal and reopening app. Without this we would still be trying to use the
internal url externally.
*/
if (oldUrlForServer != urlForServer || oldUrl?.host != url?.host) {
if (
oldUrlForServer != urlForServer ||
oldUrl?.protocol != url?.protocol ||
oldUrl?.host != url?.host ||
oldUrl?.port != url?.port
) {
view.loadUrl(
url = Uri.parse(url.toString())
.buildUpon()