mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-16 08:31:57 +02:00
13 lines
291 B
TypeScript
13 lines
291 B
TypeScript
import { platform } from "@yaakapp-internal/platform";
|
|
import { useEffect, useState } from "react";
|
|
|
|
export function useWindowFocus() {
|
|
const [visible, setVisible] = useState(true);
|
|
|
|
useEffect(() => {
|
|
return platform.window.onFocusChanged(setVisible);
|
|
}, []);
|
|
|
|
return visible;
|
|
}
|