File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,11 @@ class Client {
300300 /**
301301 * Holds configuration such as project.
302302 */
303- config = {
303+ config: {
304+ endpoint: string;
305+ endpointRealtime: string;
306+ [key: string]: string | undefined;
307+ } = {
304308 endpoint: '{{ spec .endpoint }}',
305309 endpointRealtime: '',
306310 {%~ for header in spec .global .headers %}
@@ -423,7 +427,9 @@ class Client {
423427 }
424428
425429 const channels = new URLSearchParams();
426- channels.set('project', this.config.project);
430+ if (this.config.project) {
431+ channels.set('project', this.config.project);
432+ }
427433 this.realtime.channels.forEach(channel => {
428434 channels.append('channels[]', channel);
429435 });
@@ -478,7 +484,7 @@ class Client {
478484 this.realtime.lastMessage = message;
479485 switch (message.type) {
480486 case 'connected':
481- let session = this.config? .session;
487+ let session = this.config.session;
482488 if (!session) {
483489 const cookie = JSON.parse(window.localStorage.getItem('cookieFallback') ?? '{}');
484490 session = cookie?.[`a_session_${this.config.project}`];
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ export class Realtime {
367367
368368 const messageData = message.data as RealtimeResponseConnected;
369369
370- let session = this.client.config? .session;
370+ let session = this.client.config.session;
371371 if (!session) {
372372 try {
373373 const cookie = JSON.parse(window.localStorage.getItem('cookieFallback') ?? '{}');
You can’t perform that action at this time.
0 commit comments