This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ async function createRoom() {
83
83
// Listening for remote session description below
84
84
roomRef . onSnapshot ( async snapshot => {
85
85
const data = snapshot . data ( ) ;
86
- if ( ! peerConnection . currentRemoteDescription && data . answer ) {
86
+ if ( ! peerConnection . currentRemoteDescription && data && data . answer ) {
87
87
console . log ( 'Got remote description: ' , data . answer ) ;
88
88
const rtcSessionDescription = new RTCSessionDescription ( data . answer ) ;
89
89
await peerConnection . setRemoteDescription ( rtcSessionDescription ) ;
@@ -227,11 +227,11 @@ async function hangUp(e) {
227
227
const roomRef = db . collection ( 'rooms' ) . doc ( roomId ) ;
228
228
const calleeCandidates = await roomRef . collection ( 'calleeCandidates' ) . get ( ) ;
229
229
calleeCandidates . forEach ( async candidate => {
230
- await candidate . delete ( ) ;
230
+ await candidate . ref . delete ( ) ;
231
231
} ) ;
232
232
const callerCandidates = await roomRef . collection ( 'callerCandidates' ) . get ( ) ;
233
233
callerCandidates . forEach ( async candidate => {
234
- await candidate . delete ( ) ;
234
+ await candidate . ref . delete ( ) ;
235
235
} ) ;
236
236
await roomRef . delete ( ) ;
237
237
}
You can’t perform that action at this time.
0 commit comments