frontend: remove participant name from URL handling and store in localStorage
This commit is contained in:
parent
1bf77ffde5
commit
58900c94e7
@ -265,7 +265,6 @@ export class MeetingComponent implements OnInit {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this.generateParticipantToken();
|
await this.generateParticipantToken();
|
||||||
await this.addParticipantNameToUrl();
|
|
||||||
await this.roomService.loadRoomPreferences(this.roomId);
|
await this.roomService.loadRoomPreferences(this.roomId);
|
||||||
this.showMeeting = true;
|
this.showMeeting = true;
|
||||||
|
|
||||||
@ -322,15 +321,6 @@ export class MeetingComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add participant name as a query parameter to the URL
|
|
||||||
*/
|
|
||||||
private async addParticipantNameToUrl() {
|
|
||||||
await this.navigationService.updateQueryParamsFromUrl(this.route.snapshot.queryParams, {
|
|
||||||
'participant-name': this.participantName
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onRoomCreated(room: Room) {
|
onRoomCreated(room: Room) {
|
||||||
room.on(
|
room.on(
|
||||||
RoomEvent.DataReceived,
|
RoomEvent.DataReceived,
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import { LoggerService } from 'openvidu-components-angular';
|
|||||||
})
|
})
|
||||||
export class ParticipantService {
|
export class ParticipantService {
|
||||||
protected readonly PARTICIPANTS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/participants`;
|
protected readonly PARTICIPANTS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/participants`;
|
||||||
|
protected readonly PARTICIPANT_NAME_KEY = 'ovMeet-participantName';
|
||||||
|
|
||||||
protected participantName?: string;
|
protected participantName?: string;
|
||||||
protected participantIdentity?: string;
|
protected participantIdentity?: string;
|
||||||
@ -27,10 +28,11 @@ export class ParticipantService {
|
|||||||
|
|
||||||
setParticipantName(participantName: string): void {
|
setParticipantName(participantName: string): void {
|
||||||
this.participantName = participantName;
|
this.participantName = participantName;
|
||||||
|
localStorage.setItem(this.PARTICIPANT_NAME_KEY, participantName);
|
||||||
}
|
}
|
||||||
|
|
||||||
getParticipantName(): string | undefined {
|
getParticipantName(): string | undefined {
|
||||||
return this.participantName;
|
return this.participantName || localStorage.getItem(this.PARTICIPANT_NAME_KEY) || undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
getParticipantIdentity(): string | undefined {
|
getParticipantIdentity(): string | undefined {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user