fix: Auto-reconnect on refresh by deferring torch state to torch-update

The registered handler was setting hasTorch early, causing torch-update
to see no transition and skip connectToMCP().
This commit is contained in:
2026-02-14 23:36:44 -06:00
parent cf618b1948
commit f0d8c84a64

View File

@@ -74,11 +74,8 @@ async function handleMessage(data: any) {
clientId = data.id
torchStore.setClientId(data.id)
console.log(`[Torch] Registered as ${data.id}, hasTorch: ${data.hasTorch}`)
// Just update state, don't auto-connect - user must request torch explicitly
if (data.hasTorch) {
torchStore.setTorchState(data.id)
}
// Don't set torch state here — let torch-update handle the transition
// so connectToMCP() is triggered correctly
break
}