diff --git a/relay_client.py b/relay_client.py index 4ce4677..af1935e 100644 --- a/relay_client.py +++ b/relay_client.py @@ -141,6 +141,8 @@ class RelayClient: if response.get("type") == "auth_response": if response.get("success"): + # Mark as connected before callbacks so update_ip_label works + self._connected = True new_session_id = response.get("sessionId") if new_session_id and new_session_id != self.session_id: self.session_id = new_session_id diff --git a/web/js/app.js b/web/js/app.js index c7fbbd5..b20f7bf 100644 --- a/web/js/app.js +++ b/web/js/app.js @@ -308,9 +308,16 @@ class MacroPadApp { } container.innerHTML = macroEntries.map(([id, macro]) => { - const imageSrc = macro.image_path - ? `/api/image/${macro.image_path}` - : null; + let imageSrc = null; + if (macro.image_path) { + const basePath = this.getApiUrl(`/api/image/${macro.image_path}`); + // Add password as query param for relay mode (img tags can't use headers) + if (this.relayMode && this.password) { + imageSrc = `${basePath}?password=${encodeURIComponent(this.password)}`; + } else { + imageSrc = basePath; + } + } const firstChar = macro.name.charAt(0).toUpperCase(); return `