diff --git a/app/components/public/stream/join-video.ts b/app/components/public/stream/join-video.ts index cf57e04816c..bef2b557f39 100644 --- a/app/components/public/stream/join-video.ts +++ b/app/components/public/stream/join-video.ts @@ -26,6 +26,7 @@ export default class JoinVideo extends Component { openPanel(): void { if (this.args.canAccess) { this.args.showSidePanel?.(); + this.eventCheckIn(this.args.event.identifier) this.router.transitionTo({ queryParams: { side_panel: true } }); } else { if (this.session.isAuthenticated) { @@ -35,4 +36,16 @@ export default class JoinVideo extends Component { } } } + + async eventCheckIn(event_identifier: string) { + try { + const data:any = { + 'check_in_type' : 'event', + 'is_check_in' : true + }; + await this.loader.post(`events/${event_identifier}/virtual/check-in`, data); + } catch (e) { + // Ignore error to prevent stackoverflow + } + } } diff --git a/app/components/public/stream/video-stream.ts b/app/components/public/stream/video-stream.ts index 1975dfdafc2..aac9ec505bb 100644 --- a/app/components/public/stream/video-stream.ts +++ b/app/components/public/stream/video-stream.ts @@ -170,6 +170,7 @@ export default class PublicStreamVideoStream extends Component { this.selectingLanguage.setName(null); } this.selectingLanguage.setTranslationRoomId(stream.id) + this.eventCheckIn(this.args.event.identifier, stream.microlocationId) } @action @@ -177,4 +178,20 @@ export default class PublicStreamVideoStream extends Component { this.selectingLanguage.setStreamYardVisibility(false); } + async eventCheckIn(event_identifier: string, microlocation_id: number) { + try { + const data:any = { + 'check_in_type' : 'room', + microlocation_id, + 'is_check_in' : true + }; + if (microlocation_id === undefined) { + data.check_in_type = 'virtual-room' + } + await this.loader.post(`events/${event_identifier}/virtual/check-in`, data); + } catch (e) { + // Ignore error to prevent stackoverflow + } + } + }