From e86a6e8ed68d8d9425816db722f1df5a152f774e Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Thu, 13 Mar 2025 13:12:13 +0100 Subject: [PATCH] frontend: Refactor room navigation logic to use publisherRoomUrl and simplify query parameter handling --- frontend/src/app/pages/home/home.component.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/pages/home/home.component.ts b/frontend/src/app/pages/home/home.component.ts index f07d5d8..032f668 100644 --- a/frontend/src/app/pages/home/home.component.ts +++ b/frontend/src/app/pages/home/home.component.ts @@ -149,14 +149,11 @@ export class HomeComponent implements OnInit, OnDestroy { this.roomForm.get('roomNamePrefix')?.setValue(roomNamePrefix); - const publisherUrl = new URL(room.moderatorRoomUrl); - const queryParams = publisherUrl.searchParams; - - const path = publisherUrl.pathname.slice(1); - - // !FIXME here, the participantName is not set and the guard of VideoRoomComponent will need it. - // Possibly, when standalone mode, the room should be created in prejoin page instead of home page. - this.router.navigate(['/', path], { queryParams: { secret: queryParams.get('secret') } }); + // TODO: Should create a way of select the access role (moderator/participant) + const publisherUrl = new URL(room.publisherRoomUrl); + const secret = publisherUrl.searchParams.get('secret'); + const path = publisherUrl.pathname; + this.router.navigate([path], { queryParams: { secret } }); } catch (error) { console.error('Error creating room ', error); }