From 9cdf2d123166c748582eb8e05776a3ef06f74b53 Mon Sep 17 00:00:00 2001 From: Ian Silva Date: Thu, 15 Aug 2024 12:07:23 -0300 Subject: [PATCH] feat: add presence in realtime component instead of only channels --- src/components/realtime/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/realtime/index.ts b/src/components/realtime/index.ts index 85a18493..d93339e8 100644 --- a/src/components/realtime/index.ts +++ b/src/components/realtime/index.ts @@ -7,6 +7,7 @@ import { BaseComponent } from '../base'; import { ComponentNames } from '../types'; import { Channel } from './channel'; +import { RealtimePresence } from './presence'; import { Callback, @@ -29,6 +30,7 @@ export class Realtime extends BaseComponent { event: string; callback: (data: unknown) => void; }> = []; + public participant: RealtimePresence; constructor() { super(); @@ -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); }); }