We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 52f9774 commit 6795df7Copy full SHA for 6795df7
frontend/src/lib/components/StreamListener.svelte
@@ -17,10 +17,12 @@
17
const connect = () => {
18
console.log('Attempting Connection');
19
const cleanedUrl = PUBLIC_BACKEND_URL.replace(/\/+$/, '');
20
- const cleanedEndpoint = PUBLIC_STREAM_URL.replace(/^\/+/, '');
21
- const jwt = get(JwtTokenStore);
+ const params = new URLSearchParams({ team_id: $TeamStore!.id })
+ eventSource = new EventSource(`${cleanedUrl}/api/eventlistener?${params.toString()}`);
22
23
- eventSource = new EventSource(`${cleanedUrl}/${cleanedEndpoint}?team_id=${$TeamStore?.id}`);
+ eventSource.onopen = (event) => {
24
+ alert('Connection Established')
25
+ }
26
27
eventSource.onmessage = (event) => {
28
alert(event.data);
0 commit comments