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
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user