Compare commits

...

1 Commits

Author SHA1 Message Date
lebaudantoine cffd658825 🩹(sdk) notify iframe parent when room is gathered through callback
On the first room creation, when the authentication redirection takes
place, the iframe wasn't properly messaging the parent.
Fixed it. Send the room data in any of the two methods to acquire it.

Actually, the code when gathering data through the callback endpoint is
a bit dirty.
2025-04-04 13:18:17 +02:00
2 changed files with 12 additions and 1 deletions
@@ -48,6 +48,12 @@ export const CreateMeetingButton = () => {
setRoom(data.room)
setCallbackId(undefined)
setIsPending(false)
popupManager.sendRoomData({
room: {
url: getRouteUrl('room', data.room.slug),
...data.room,
},
})
}, [data])
useEffect(() => {
@@ -39,6 +39,11 @@ export class PopupManager {
this.messageParent(ClientMessageType.STATE_CLEAR, {})
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public sendRoomData(data: { room: any }) {
this.messageParent(ClientMessageType.ROOM_CREATED, data)
}
public setupMessageListener(
onCallbackId: (id: string) => void,
onRoomData: (data: CallbackCreationRoomData) => void
@@ -54,7 +59,7 @@ export class PopupManager {
case PopupMessageType.ROOM_DATA:
if (!data?.room) return
onRoomData(data.room)
this.messageParent(ClientMessageType.ROOM_CREATED, {
this.sendRoomData({
room: {
url: getRouteUrl('room', data.room.slug),
...data.room,