set tabs to connecting on extension replace

This commit is contained in:
Tommy D. Rossi
2025-12-28 12:20:50 +01:00
parent b7d0fcf365
commit 9b115ea2eb
+9 -1
View File
@@ -507,7 +507,15 @@ function handleConnectionClose(reason: string, code: number): void {
return
}
store.setState({ connectionState: 'disconnected', errorText: undefined })
store.setState((state) => {
const newTabs = new Map(state.tabs)
for (const [tabId, tab] of newTabs) {
if (tab.state === 'connected') {
newTabs.set(tabId, { ...tab, state: 'connecting' })
}
}
return { tabs: newTabs, connectionState: 'disconnected', errorText: undefined }
})
if (tabs.size > 0) {
logger.debug('Tabs still connected, triggering reconnection')