Skip to content

Commit bde749d

Browse files
close realtime socket properly on unsubscribe
1 parent ad80d80 commit bde749d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/web/src/client.ts.twig

+5-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ class Client {
186186
}
187187
},
188188
createSocket: () => {
189-
if (this.realtime.channels.size < 1) return;
189+
if (this.realtime.channels.size < 1) {
190+
this.realtime.reconnect = false;
191+
this.realtime.socket.close();
192+
return;
193+
}
190194

191195
const channels = new URLSearchParams();
192196
channels.set('project', this.config.project);

0 commit comments

Comments
 (0)