mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-07-17 15:57:13 +00:00
fix(hooks/useGamepad): focus state (#110)
This commit is contained in:
parent
2e8e6cdec3
commit
121a0bf4cf
|
|
@ -41,6 +41,7 @@ export const useGamepad = ({ playSfx, isWindowVisible }: UseGamepadProps) => {
|
|||
};
|
||||
|
||||
const update = useCallback(() => {
|
||||
focusedRef.current = document.hasFocus();
|
||||
if (!focusedRef.current) {
|
||||
requestRef.current = requestAnimationFrame(update);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue