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

Commit 1c8d402

Browse files
Merge pull request #750 from SuperViz/feat/presence-default-channel-realtime
feat: add presence in realtime component instead of only channels
2 parents 8d5beeb + 9cdf2d1 commit 1c8d402

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/realtime/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { BaseComponent } from '../base';
77
import { ComponentNames } from '../types';
88

99
import { Channel } from './channel';
10+
import { RealtimePresence } from './presence';
1011

1112
import {
1213
Callback,
@@ -29,6 +30,7 @@ export class Realtime extends BaseComponent {
2930
event: string;
3031
callback: (data: unknown) => void;
3132
}> = [];
33+
public participant: RealtimePresence;
3234

3335
constructor() {
3436
super();
@@ -139,6 +141,7 @@ export class Realtime extends BaseComponent {
139141
this.callbacksToSubscribeWhenJoined = [];
140142

141143
this.channel.unsubscribe(RealtimeChannelEvent.REALTIME_CHANNEL_STATE_CHANGED);
144+
this.participant = this.channel.participant;
142145
this.channels.set('default', this.channel);
143146
});
144147
}

0 commit comments

Comments
 (0)