@@ -210,25 +210,11 @@ const publishVideo = async (
210
210
} ;
211
211
212
212
const 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 ) } ) ;
221
214
} ;
222
215
223
216
const 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 ) ;
232
218
} ;
233
219
234
220
const rtmInit = async ( appId : any , uid : any , channel : any ) => {
@@ -238,26 +224,9 @@ const rtmInit = async (appId: any, uid: any, channel: any) => {
238
224
} ;
239
225
await rtmClient . login ( options ) ;
240
226
241
- rtmClient . on ( "ConnectionStateChanged" , function ( state , reason ) {
242
- console . log ( "State changed To: " + state + " Reason: " + reason ) ;
243
- } ) ;
244
-
245
227
rtmChannelResponse = rtmClient . createChannel ( channel ) ;
246
228
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 ( ) ;
261
230
} ;
262
231
263
232
export const meetingControllerChildren = {
@@ -322,7 +291,6 @@ let MTComp = (function () {
322
291
323
292
useEffect ( ( ) => {
324
293
if ( updateVolume . userid ) {
325
- console . log ( "userIds " , props . participants ) ;
326
294
let prevUsers : [ ] = props . participants as [ ] ;
327
295
328
296
const updatedItems = prevUsers . map ( ( userInfo : any ) => {
@@ -334,8 +302,6 @@ let MTComp = (function () {
334
302
}
335
303
return userInfo ;
336
304
} ) ;
337
- console . log ( "updatedItems" , updatedItems ) ;
338
-
339
305
dispatch (
340
306
changeChildAction ( "participants" , getData ( updatedItems ) . data , false )
341
307
) ;
@@ -365,7 +331,6 @@ let MTComp = (function () {
365
331
if ( newUsers . length == 0 ) return ;
366
332
newUsers = props . localUser . value ;
367
333
let updatedUsers = [ ...userIds , newUsers ] ;
368
- console . log ( "updatedUsers" , updatedUsers ) ;
369
334
dispatch (
370
335
changeChildAction ( "participants" , getData ( updatedUsers ) . data , false )
371
336
) ;
@@ -375,13 +340,9 @@ let MTComp = (function () {
375
340
useEffect ( ( ) => {
376
341
if ( rtmChannelResponse ) {
377
342
rtmClient . on ( "MessageFromPeer" , function ( message , peerId ) {
378
- console . log (
379
- "Message from: " + peerId + " Message: " + message . text
380
- ) ;
381
343
setRtmMessages ( message . text ) ;
382
344
} ) ;
383
345
rtmChannelResponse . on ( "ChannelMessage" , function ( message , memberId ) {
384
- console . log ( "Message received from: " + memberId , message . text ) ;
385
346
setRtmMessages ( message . text ) ;
386
347
dispatch (
387
348
changeChildAction ( "messages" , getData ( rtmMessages ) . data , false )
0 commit comments