From 72695567cde2bf07b6a048d345860eaac1ee8c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joris=20Pelgr=C3=B6m?= Date: Tue, 26 Mar 2024 16:19:35 +0100 Subject: [PATCH] Check protocol/port when determining reload for WebView - 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. --- .../companion/android/webview/WebViewPresenterImpl.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/homeassistant/companion/android/webview/WebViewPresenterImpl.kt b/app/src/main/java/io/homeassistant/companion/android/webview/WebViewPresenterImpl.kt index 20eb6212bd5..3bb397439cd 100644 --- a/app/src/main/java/io/homeassistant/companion/android/webview/WebViewPresenterImpl.kt +++ b/app/src/main/java/io/homeassistant/companion/android/webview/WebViewPresenterImpl.kt @@ -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()