Skip to content

Commit

Permalink
ISSUE #5038 - fixed updating unmounted camera offsight
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmont3drepo committed Sep 23, 2024
1 parent 2e150c7 commit 12b952e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ export const useModelLoading = () => {
const [loading, setLoading] = useState(true);

useEffect(() => {
ViewerService.isModelReady().then(() => setLoading(false));
let mounted = true;

ViewerService.isModelReady().then(() => {
if (!mounted) return;
setLoading(false);
});

return () => {mounted = false;};
}, []);

return loading;
Expand Down

0 comments on commit 12b952e

Please sign in to comment.