Pusher username setting fully working

This commit is contained in:
James Barnsley
2016-10-28 15:58:07 +13:00
parent 64e5472e2c
commit f4ca6b7fde
10 changed files with 86 additions and 23 deletions

View File

@ -34,9 +34,11 @@ class PusherConnectionList extends React.Component{
<div className="pusher-connection-list">
{
this.props.pusher.connections.map( (connection, index) => {
var isMe = false;
if( connection.connectionid == this.props.pusher.connectionid ) isMe = true;
return (
<div className="connection cf" key={connection.connectionid}>
<div className="col w20 one-liner">{ connection.username }</div>
<div className="col w20">{ connection.username } { isMe ? <span>(you)</span> : null }</div>
<div className="col w20 one-liner">{ connection.ip }</div>
<div className="col w20 one-liner">{ connection.connectionid }</div>
</div>

View File

@ -75,7 +75,7 @@ class SpotifyAuthenticationFrame extends React.Component{
}else if( this.props.spotify.authorized ){
return (
<div>
<button onClick={() => this.props.actions.removeAuthorization()}>Log out</button>
<button onClick={() => this.props.actions.authorizationRevoked()}>Log out</button>
{ this.renderMe() }
</div>
);