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