Skip to content

Commit 82a83e6

Browse files
committed
Show yourself label in peer list.
1 parent 29cafff commit 82a83e6

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/App.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,20 @@ class App extends Component {
185185
<List>
186186
{
187187
this.state.peers.map((peer, i) => {
188-
if(peer.id === this.state.self_id)
189-
return null;
190188
return (
191189
<div key={peer.id}>
192190
<ListItem button >
193-
<ListItemText primary={peer.name + ' [' + peer.user_agent + ']'} secondary={'id: ' + peer.id} />
194-
<IconButton color="primary" onClick={() => this.handleInvitePeer(peer.id, 'audio')} className={classes.button} aria-label="Make a voice call.">
195-
<CallIcon />
196-
</IconButton>
197-
<IconButton color="primary" onClick={() => this.handleInvitePeer(peer.id, 'video')} className={classes.button} aria-label="Make a video call.">
198-
<VideoCamIcon />
199-
</IconButton>
191+
<ListItemText primary={peer.name + ' [' + peer.user_agent + ']' + (peer.id === this.state.self_id ? ' (Yourself)' : '')} secondary={ (peer.id === this.state.self_id ? 'self' : 'peer') + '-id: ' + peer.id} />
192+
{peer.id !== this.state.self_id &&
193+
<div>
194+
<IconButton color="primary" onClick={() => this.handleInvitePeer(peer.id, 'audio')} className={classes.button} aria-label="Make a voice call.">
195+
<CallIcon />
196+
</IconButton>
197+
<IconButton color="primary" onClick={() => this.handleInvitePeer(peer.id, 'video')} className={classes.button} aria-label="Make a video call.">
198+
<VideoCamIcon />
199+
</IconButton>
200+
</div>
201+
}
200202
</ListItem>
201203
<Divider />
202204
</div>

0 commit comments

Comments
 (0)