frontend: enhance clear room session guard to include meeting context cleanup
This commit is contained in:
parent
cf64838c9b
commit
b23445d063
@ -1,19 +1,22 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { CanActivateFn } from '@angular/router';
|
||||
import { SessionStorageService } from '../../../shared/services/session-storage.service';
|
||||
import { MeetingContextService } from '../../meeting/services/meeting-context.service';
|
||||
import { RoomMemberContextService } from '../../room-members/services/room-member-context.service';
|
||||
|
||||
/**
|
||||
* Guard that clears room-related session data when entering console routes.
|
||||
* This ensures roomSecret, e2eeData and room member context are only removed when navigating to console,
|
||||
* This ensures roomSecret, e2eeData, room member and meeting context are only removed when navigating to console,
|
||||
* not when leaving a meeting to go to other non-console pages (like disconnected, room recordings, etc.)
|
||||
*/
|
||||
export const clearRoomSessionGuard: CanActivateFn = () => {
|
||||
const sessionStorageService = inject(SessionStorageService);
|
||||
const roomMemberContextService = inject(RoomMemberContextService);
|
||||
const meetingContextService = inject(MeetingContextService);
|
||||
|
||||
// Clear room member context
|
||||
// Clear room member and meeting context
|
||||
roomMemberContextService.clearContext();
|
||||
meetingContextService.clearContext();
|
||||
|
||||
// Clear room-related data from session storage
|
||||
sessionStorageService.removeRoomSecret();
|
||||
|
||||
@ -123,9 +123,6 @@ export class MeetingComponent implements OnInit {
|
||||
this.destroy$.next();
|
||||
this.destroy$.complete();
|
||||
|
||||
// Clear meeting context when component is destroyed
|
||||
this.meetingContextService.clearContext();
|
||||
|
||||
// Cleanup captions service
|
||||
this.captionsService.destroy();
|
||||
}
|
||||
|
||||
@ -188,15 +188,15 @@ export class MeetingContextService {
|
||||
* Clears the meeting context
|
||||
*/
|
||||
clearContext(): void {
|
||||
this._meetRoom.set(undefined);
|
||||
this._lkRoom.set(undefined);
|
||||
this._roomId.set(undefined);
|
||||
this._meetRoom.set(undefined);
|
||||
this._meetingUrl.set('');
|
||||
this._roomSecret.set(undefined);
|
||||
this._e2eeKey.set('');
|
||||
this._isE2eeKeyFromUrl.set(false);
|
||||
this._roomSecret.set(undefined);
|
||||
this._hasRecordings.set(false);
|
||||
this._meetingEndedBy.set(null);
|
||||
this._lkRoom.set(undefined);
|
||||
this._localParticipant.set(undefined);
|
||||
this._remoteParticipants.set([]);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user