mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2025-12-06 12:20:20 +01:00
Tweaks to format/logic
This commit is contained in:
parent
8c58ee7a62
commit
acbea405da
|
|
@ -1,7 +1,7 @@
|
|||
import styled from "styled-components";
|
||||
|
||||
type StyledStableDiffusionProps = {
|
||||
$hasWebGPU?: boolean;
|
||||
$hasWebGPU: boolean;
|
||||
};
|
||||
|
||||
const StyledStableDiffusion = styled.div<StyledStableDiffusionProps>`
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user