diff options
| -rw-r--r-- | ui/lib/apiServer.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/lib/apiServer.js b/ui/lib/apiServer.js index e52daff..e541d43 100644 --- a/ui/lib/apiServer.js +++ b/ui/lib/apiServer.js @@ -55,9 +55,13 @@ export async function acceptInvite(inviteId, username, password) { } export function subscribeToEvents(resumePoint) { - const eventsUrl = new URL('/api/events', window.location); - eventsUrl.searchParams.append('resume_point', resumePoint); - const evtSource = new EventSource(eventsUrl.toString()); + const eventsUrl = apiServer.getUri({ + url: '/events', + params: { + resume_point: resumePoint + } + }); + const evtSource = new EventSource(eventsUrl); // TODO: this should process all incoming events and store them. // TODO: eventually we'll need to handle expiring old info, so as not to use // infinite browser memory. |
