Skip to content

Commit

Permalink
Point space cadet peek at canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinBrett committed Dec 18, 2024
1 parent 37a1b56 commit 2049bbd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/apps/SpaceCadet/useSpaceCadet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const useSpaceCadet = ({
id,
setLoading,
}: ContainerHookProps): void => {
const { processes: { [id]: { libs = [] } = {} } = {} } = useProcesses();
const { linkElement, processes: { [id]: { libs = [] } = {} } = {} } =
useProcesses();
const [canvas, setCanvas] = useState<HTMLCanvasElement>();
const mountEmFs = useEmscriptenMount();

Expand All @@ -36,11 +37,12 @@ const useSpaceCadet = ({
postRun: () => {
setLoading(false);
mountEmFs(window.FS as EmscriptenFS, "SpaceCadet");
linkElement(id, "peekElement", containerCanvas);
},
};
setCanvas(containerCanvas);
}
}, [containerRef, mountEmFs, setLoading]);
}, [containerRef, id, linkElement, mountEmFs, setLoading]);

useEffect(() => {
if (canvas) {
Expand Down

0 comments on commit 2049bbd

Please sign in to comment.