Don't bail command palette if there's no engineConnection (#6286)

The connection can't be bad if there is not yet `:galaxy-brain:`.

But seriously this behavior regressed share links because we would bail
from the command palette because the connection wasn't healthy.
This commit is contained in:
Frank Noirot
2025-04-11 14:24:56 -04:00
committed by GitHub
parent c0aa763c3b
commit 129b91518f

View File

@ -10,6 +10,7 @@ import Tooltip from '@src/components/Tooltip'
import { useNetworkContext } from '@src/hooks/useNetworkContext'
import { EngineConnectionStateType } from '@src/lang/std/engineConnection'
import useHotkeyWrapper from '@src/lib/hotkeyWrapper'
import { engineCommandManager } from '@src/lib/singletons'
import {
commandBarActor,
useCommandBarState,
@ -46,6 +47,7 @@ export const CommandBar = () => {
useEffect(() => {
if (
!commandBarActor.getSnapshot().matches('Closed') &&
engineCommandManager.engineConnection &&
(immediateState.type === EngineConnectionStateType.Disconnecting ||
immediateState.type === EngineConnectionStateType.Disconnected)
) {