Skip to content

Commit 8f36d8f

Browse files
author
cloudwebrtc
committed
Update.
1 parent 55c485b commit 8f36d8f

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/App.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ class App extends Component {
411411
}
412412

413413
invitePeer = (peer_id, type) => {
414+
this.setState({ joined: true, open: true });
414415
this.invite(peer_id, type);
415-
this.setState({ joined: true });
416416
this.getLocalStream(type);
417417
}
418418

@@ -431,11 +431,6 @@ class App extends Component {
431431
}
432432
}
433433

434-
handleInvite = (id, type) => {
435-
this.setState({ open: true });
436-
this.invitePeer(id, type);
437-
}
438-
439434
handleClickOpen = () => {
440435
this.setState({ open: true });
441436
};
@@ -469,10 +464,10 @@ class App extends Component {
469464
<div>
470465
<ListItem button>
471466
<ListItemText primary={peer.name + ' [' + peer.user_agent + ']'} secondary={'id: ' + peer.id} />
472-
<IconButton color="primary" onClick={() => this.handleInvite(peer.id, 'audio')} className={classes.button} aria-label="Make a voice call.">
467+
<IconButton color="primary" onClick={() => this.invitePeer(peer.id, 'audio')} className={classes.button} aria-label="Make a voice call.">
473468
<CallIcon />
474469
</IconButton>
475-
<IconButton color="primary" onClick={() => this.handleInvite(peer.id, 'video')} className={classes.button} aria-label="Make a video call.">
470+
<IconButton color="primary" onClick={() => this.invitePeer(peer.id, 'video')} className={classes.button} aria-label="Make a video call.">
476471
<VideoCamIcon />
477472
</IconButton>
478473
</ListItem>

0 commit comments

Comments
 (0)