Switch projects fix (#3310)

* switch projects fix

* add comment
This commit is contained in:
Kurt Hutten
2024-08-07 19:47:23 +10:00
committed by GitHub
parent f875efab1b
commit dff3848a00

View File

@ -185,6 +185,18 @@ export const Stream = () => {
}
}, [IDLE, streamState])
// HOT FIX: for https://github.com/KittyCAD/modeling-app/pull/3250
// TODO review if there's a better way to play the stream again.
useEffect(() => {
if (!kclManager.isFirstRender)
setTimeout(() =>
// execute in the next event loop
videoRef.current?.play().catch((e) => {
console.warn('Video playing was prevented', e, videoRef.current)
})
)
}, [kclManager.isFirstRender])
useEffect(() => {
if (
typeof window === 'undefined' ||