Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #750 from SuperViz/feat/presence-default-channel-r…
Browse files Browse the repository at this point in the history
…ealtime

feat: add presence in realtime component instead of only channels
  • Loading branch information
carlossantos74 authored Aug 15, 2024
2 parents 8d5beeb + 9cdf2d1 commit 1c8d402
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/realtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { BaseComponent } from '../base';
import { ComponentNames } from '../types';

import { Channel } from './channel';
import { RealtimePresence } from './presence';

import {
Callback,
Expand All @@ -29,6 +30,7 @@ export class Realtime extends BaseComponent {
event: string;
callback: (data: unknown) => void;
}> = [];
public participant: RealtimePresence;

constructor() {
super();
Expand Down Expand Up @@ -139,6 +141,7 @@ export class Realtime extends BaseComponent {
this.callbacksToSubscribeWhenJoined = [];

this.channel.unsubscribe(RealtimeChannelEvent.REALTIME_CHANNEL_STATE_CHANGED);
this.participant = this.channel.participant;
this.channels.set('default', this.channel);
});
}
Expand Down

0 comments on commit 1c8d402

Please sign in to comment.