feat(webui): polish agent output and app discovery
This commit is contained in:
1 parent
b189a37648
commit
aa8387fb4d
87 files changed
+6225
-2379
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
function pageIsVisible(): boolean {
|
||||
return typeof document === "undefined" || document.visibilityState !== "hidden";
|
||||
}
|
||||
|
||||
/** Keep background tabs quiet while resuming work immediately on return. */
|
||||
export function usePageVisibility(): boolean {
|
||||
const [visible, setVisible] = useState(pageIsVisible);
|
||||
|
||||
useEffect(() => {
|
||||
const update = () => setVisible(pageIsVisible());
|
||||
document.addEventListener("visibilitychange", update);
|
||||
return () => document.removeEventListener("visibilitychange", update);
|
||||
}, []);
|
||||
|
||||
return visible;
|
||||
}
|
||||
Reference in new issue
Block a user