mirror of
https://github.com/temetro/temetro.git
synced 2026-08-27 19:06:52 +00:00
fix: don't show a bogus container IP for the network address under Docker
/api/network reported the container's bridge IP (172.x) when running in Docker, which surfaced as a broken/"Error" value in Settings → About & updates. Skip container-internal interfaces (detected via /.dockerenv) so the endpoint returns no address inside a container, and guard the panel against an unexpected response shape — both paths fall back to the helpful "open via the server's IP" hint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,9 @@ export function VersionPanel() {
|
||||
useEffect(() => {
|
||||
if (localShareUrl) return;
|
||||
getNetworkInfo()
|
||||
.then((n) => setNetworkUrls(n.urls))
|
||||
// Guard against an unexpected shape so a missing/garbled response shows the
|
||||
// helpful "open via the server's IP" hint rather than a broken value.
|
||||
.then((n) => setNetworkUrls(Array.isArray(n?.urls) ? n.urls : []))
|
||||
.catch(() => setNetworkUrls([]));
|
||||
}, [localShareUrl]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user