Tweaks to format/logic

This commit is contained in:
Dustin Brett 2024-08-10 12:22:34 -07:00
parent 8c58ee7a62
commit acbea405da
3 changed files with 4 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import styled from "styled-components";
type StyledStableDiffusionProps = {
$hasWebGPU?: boolean;
$hasWebGPU: boolean;
};
const StyledStableDiffusion = styled.div<StyledStableDiffusionProps>`

View File

@ -4,7 +4,6 @@ import { useSession } from "contexts/session";
const useNextFocusable = (id: string): string => {
const { stackOrder = [] } = useSession();
const { processes } = useProcesses();
const nextFocusableId = stackOrder.find(
(stackId) => stackId !== id && !processes?.[stackId]?.minimized
);

View File

@ -44,15 +44,15 @@ const supportsWebGPU = async (): Promise<boolean> => {
return !insufficientLimits;
};
export const useWebGPUCheck = (): boolean | undefined => {
const [hasWebGPU, setHasWebGPU] = useState<boolean | undefined>();
export const useWebGPUCheck = (): boolean => {
const [hasWebGPU, setHasWebGPU] = useState<boolean>(false);
const checkWebGPU = useCallback(
async () => setHasWebGPU(await supportsWebGPU()),
[]
);
useEffect(() => {
checkWebGPU();
requestAnimationFrame(checkWebGPU);
}, [checkWebGPU]);
return hasWebGPU;