Files
homeai/homeai-desktop/src/hooks/useBridgeHealth.js
Aodhan Collins 0c33de607f feat: add homeai-desktop web assistant with LAN access
Adds the desktop web assistant app (Vite + React) with OpenClaw bridge
proxy and exposes it on the local network (host: 0.0.0.0, port 5174).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 18:16:09 +00:00

19 lines
458 B
JavaScript

import { useState, useEffect, useRef } from 'react'
import { healthCheck } from '../lib/api'
export function useBridgeHealth() {
const [isOnline, setIsOnline] = useState(null)
const intervalRef = useRef(null)
useEffect(() => {
const check = async () => {
setIsOnline(await healthCheck())
}
check()
intervalRef.current = setInterval(check, 15000)
return () => clearInterval(intervalRef.current)
}, [])
return isOnline
}