feat: Bundled NW.js with appimages
feat: Implemented self update feat: Added rclone saves for emulators fix: Fixed auto focus in builds feat: Added helper cards on empty library
This commit is contained in:
parent
587956c792
commit
813785f4f3
59 changed files with 1210 additions and 480 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { doesFocusableExist, FocusDetails, getCurrentFocusKey } from "@noriginmedia/norigin-spatial-navigation";
|
||||
import { useLayoutEffect } from "react";
|
||||
import { useEffect, useLayoutEffect } from "react";
|
||||
|
||||
export function AutoFocus (data: {
|
||||
parentKey?: string;
|
||||
|
|
@ -8,11 +8,15 @@ export function AutoFocus (data: {
|
|||
delay?: number;
|
||||
})
|
||||
{
|
||||
useLayoutEffect(() =>
|
||||
useEffect(() =>
|
||||
{
|
||||
let delayTimeout: number | undefined;
|
||||
|
||||
if (data.force || !getCurrentFocusKey() || getCurrentFocusKey() === data.parentKey || !doesFocusableExist(getCurrentFocusKey()))
|
||||
const focusDoesntExist = !doesFocusableExist(getCurrentFocusKey());
|
||||
const parentFocus = getCurrentFocusKey() === data.parentKey;
|
||||
const noFocus = !getCurrentFocusKey();
|
||||
|
||||
if (data.force || noFocus || parentFocus || focusDoesntExist)
|
||||
{
|
||||
if (data.delay)
|
||||
{
|
||||
|
|
@ -21,8 +25,8 @@ export function AutoFocus (data: {
|
|||
{
|
||||
data.focus({ instant: true });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return () =>
|
||||
{
|
||||
if (delayTimeout)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue