@@ -210,25 +210,11 @@ const publishVideo = async (
210210} ;
211211
212212const sendMessageRtm = ( message : any ) => {
213- rtmChannelResponse
214- . sendMessage ( { text : JSON . stringify ( message ) } )
215- . then ( ( ) => {
216- console . log ( "message sent " + JSON . stringify ( message ) ) ;
217- } )
218- . catch ( ( e : any ) => {
219- console . log ( "error" , e ) ;
220- } ) ;
213+ rtmChannelResponse . sendMessage ( { text : JSON . stringify ( message ) } ) ;
221214} ;
222215
223216const sendPeerMessageRtm = ( message : any , toId : string ) => {
224- rtmClient
225- . sendMessageToPeer ( { text : JSON . stringify ( message ) } , toId )
226- . then ( ( ) => {
227- console . log ( "message sent " + JSON . stringify ( message ) ) ;
228- } )
229- . catch ( ( e : any ) => {
230- console . log ( "error" , e ) ;
231- } ) ;
217+ rtmClient . sendMessageToPeer ( { text : JSON . stringify ( message ) } , toId ) ;
232218} ;
233219
234220const rtmInit = async ( appId : any , uid : any , channel : any ) => {
@@ -238,26 +224,9 @@ const rtmInit = async (appId: any, uid: any, channel: any) => {
238224 } ;
239225 await rtmClient . login ( options ) ;
240226
241- rtmClient . on ( "ConnectionStateChanged" , function ( state , reason ) {
242- console . log ( "State changed To: " + state + " Reason: " + reason ) ;
243- } ) ;
244-
245227 rtmChannelResponse = rtmClient . createChannel ( channel ) ;
246228
247- await rtmChannelResponse . join ( ) . then ( async ( ) => {
248- console . log (
249- "You have successfully joined channel " + rtmChannelResponse . channelId
250- ) ;
251- } ) ;
252-
253- // Display channel member stats
254- rtmChannelResponse . on ( "MemberJoined" , function ( memberId ) {
255- console . log ( memberId + " joined the channel" ) ;
256- } ) ;
257- // Display channel member stats
258- rtmChannelResponse . on ( "MemberLeft" , function ( memberId ) {
259- console . log ( memberId + " left the channel" ) ;
260- } ) ;
229+ await rtmChannelResponse . join ( ) ;
261230} ;
262231
263232export const meetingControllerChildren = {
@@ -322,7 +291,6 @@ let MTComp = (function () {
322291
323292 useEffect ( ( ) => {
324293 if ( updateVolume . userid ) {
325- console . log ( "userIds " , props . participants ) ;
326294 let prevUsers : [ ] = props . participants as [ ] ;
327295
328296 const updatedItems = prevUsers . map ( ( userInfo : any ) => {
@@ -334,8 +302,6 @@ let MTComp = (function () {
334302 }
335303 return userInfo ;
336304 } ) ;
337- console . log ( "updatedItems" , updatedItems ) ;
338-
339305 dispatch (
340306 changeChildAction ( "participants" , getData ( updatedItems ) . data , false )
341307 ) ;
@@ -365,7 +331,6 @@ let MTComp = (function () {
365331 if ( newUsers . length == 0 ) return ;
366332 newUsers = props . localUser . value ;
367333 let updatedUsers = [ ...userIds , newUsers ] ;
368- console . log ( "updatedUsers" , updatedUsers ) ;
369334 dispatch (
370335 changeChildAction ( "participants" , getData ( updatedUsers ) . data , false )
371336 ) ;
@@ -375,13 +340,9 @@ let MTComp = (function () {
375340 useEffect ( ( ) => {
376341 if ( rtmChannelResponse ) {
377342 rtmClient . on ( "MessageFromPeer" , function ( message , peerId ) {
378- console . log (
379- "Message from: " + peerId + " Message: " + message . text
380- ) ;
381343 setRtmMessages ( message . text ) ;
382344 } ) ;
383345 rtmChannelResponse . on ( "ChannelMessage" , function ( message , memberId ) {
384- console . log ( "Message received from: " + memberId , message . text ) ;
385346 setRtmMessages ( message . text ) ;
386347 dispatch (
387348 changeChildAction ( "messages" , getData ( rtmMessages ) . data , false )
0 commit comments