File tree Expand file tree Collapse file tree 2 files changed +24
-12
lines changed
frontend/src/app/shared/services Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,15 @@ export class OpenViduService {
3838 }
3939
4040 syncRemoveUser ( roomName : string ) {
41- fetch ( this . baseURL + '/room/' + roomName + '/user' , {
42- method : 'DELETE' ,
43- keepalive : true
44- } ) ;
41+ if ( this . userSrv . isLogged && ! ! roomName ) {
42+ let headers = new Headers ( ) ;
43+ headers . set ( 'Authorization' , `Basic ${ this . userSrv . user . authdata } ` ) ;
44+ fetch ( this . baseURL + '/room/' + roomName + '/user' , {
45+ method : 'DELETE' ,
46+ headers : headers ,
47+ keepalive : true
48+ } ) ;
49+ }
4550 }
4651
4752 getToken ( mySessionId : string ) : Promise < string > {
Original file line number Diff line number Diff line change @@ -84,14 +84,21 @@ export class RoomService {
8484 }
8585
8686 syncLowerHand ( roomName : string , connectionId : string ) {
87- let body = {
88- "connectionId" : connectionId
89- } ;
90- fetch ( this . baseURL + '/room/' + roomName + '/raiseHand' , {
91- method : 'DELETE' ,
92- body : JSON . stringify ( body ) ,
93- keepalive : true
94- } ) ;
87+ if ( this . userService . isLogged && ! ! roomName ) {
88+ let body = {
89+ connectionId : connectionId
90+ } ;
91+ let headers = new Headers ( ) ;
92+ headers . set ( 'Authorization' , `Basic ${ this . userService . user . authdata } ` ) ;
93+ headers . set ( 'Accept' , 'application/json' ) ;
94+ headers . set ( 'Content-Type' , 'application/json' ) ;
95+ fetch ( this . baseURL + '/room/' + roomName + '/raiseHand' , {
96+ method : 'DELETE' ,
97+ body : JSON . stringify ( body ) ,
98+ headers : headers ,
99+ keepalive : true
100+ } ) ;
101+ }
95102 }
96103
97104 private handleError ( error : any ) {
You can’t perform that action at this time.
0 commit comments