[FIX]: "Connecting to engine" overlay shows too often (#6350)

* Use the engineStreamState that's available right there silly

* fix lint

* Just look at playing/paused

---------

Co-authored-by: Jace Browning <jacebrowning@gmail.com>
This commit is contained in:
Frank Noirot
2025-04-17 08:49:31 -04:00
committed by GitHub
parent bab79331cb
commit 056a4d4a22

View File

@ -5,10 +5,7 @@ import { useModelingContext } from '@src/hooks/useModelingContext'
import { useNetworkContext } from '@src/hooks/useNetworkContext'
import { NetworkHealthState } from '@src/hooks/useNetworkStatus'
import { getArtifactOfTypes } from '@src/lang/std/artifactGraph'
import {
EngineCommandManagerEvents,
EngineConnectionStateType,
} from '@src/lang/std/engineConnection'
import { EngineCommandManagerEvents } from '@src/lang/std/engineConnection'
import { btnName } from '@src/lib/cameraControls'
import { PATHS } from '@src/lib/paths'
import { sendSelectEventToEngine } from '@src/lib/selections'
@ -430,8 +427,9 @@ export const EngineStream = (props: {
}
menuTargetElement={videoWrapperRef}
/>
{engineCommandManager.engineConnection?.state.type !==
EngineConnectionStateType.ConnectionEstablished && (
{![EngineStreamState.Playing, EngineStreamState.Paused].some(
(s) => s === engineStreamState.value
) && (
<Loading dataTestId="loading-engine" className="fixed inset-0">
Connecting to engine
</Loading>