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() {
8383 // Listening for remote session description below
8484 roomRef . onSnapshot ( async snapshot => {
8585 const data = snapshot . data ( ) ;
86- if ( ! peerConnection . currentRemoteDescription && data . answer ) {
86+ if ( ! peerConnection . currentRemoteDescription && data && data . answer ) {
8787 console . log ( 'Got remote description: ' , data . answer ) ;
8888 const rtcSessionDescription = new RTCSessionDescription ( data . answer ) ;
8989 await peerConnection . setRemoteDescription ( rtcSessionDescription ) ;
@@ -227,11 +227,11 @@ async function hangUp(e) {
227227 const roomRef = db . collection ( 'rooms' ) . doc ( roomId ) ;
228228 const calleeCandidates = await roomRef . collection ( 'calleeCandidates' ) . get ( ) ;
229229 calleeCandidates . forEach ( async candidate => {
230- await candidate . delete ( ) ;
230+ await candidate . ref . delete ( ) ;
231231 } ) ;
232232 const callerCandidates = await roomRef . collection ( 'callerCandidates' ) . get ( ) ;
233233 callerCandidates . forEach ( async candidate => {
234- await candidate . delete ( ) ;
234+ await candidate . ref . delete ( ) ;
235235 } ) ;
236236 await roomRef . delete ( ) ;
237237 }
You can’t perform that action at this time.
0 commit comments