Skip to content

Commit 24acd75

Browse files
ThomasHalwaxclaude
andcommitted
fix: disconnect live data sources regardless of connection state when disabled
When a live data source server went down, EventSource entered the CONNECTING (reconnecting) state. Disabling the source only called disconnect() when isConnected() was true (readyState === OPEN), so reconnecting sources were never stopped. Closes #102 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 641f5c2 commit 24acd75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/renderer/store/SSELayerStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ SSELayerStore.prototype.updateOrCreateService = function (key, service) {
119119
// Handle enabled state change
120120
if (service.enabled && service.url && !source.isConnected()) {
121121
source.connect()
122-
} else if (!service.enabled && source.isConnected()) {
122+
} else if (!service.enabled) {
123123
source.disconnect()
124124
source.clear()
125125
}

0 commit comments

Comments
 (0)