Fixing pusher name set
This commit is contained in:
@ -166,7 +166,7 @@ class PusherWebsocketHandler(tornado.websocket.WebSocketHandler):
|
||||
elif messageJson['action'] == 'change_username':
|
||||
|
||||
# username is the only value we allow clients to change
|
||||
connections[messageJson['origin']['connectionid']]['client']['username'] = messageJson['data']
|
||||
connections[messageJson['origin']['connectionid']]['client']['username'] = messageJson['username']
|
||||
|
||||
# respond to request
|
||||
send_message(
|
||||
|
||||
@ -10,14 +10,6 @@ export function setPort( port ){
|
||||
}
|
||||
}
|
||||
|
||||
export function changeUsername( username ){
|
||||
return {
|
||||
type: 'PUSHER_INSTRUCT',
|
||||
action: 'change_username',
|
||||
data: username
|
||||
}
|
||||
}
|
||||
|
||||
export function connect(){
|
||||
return {
|
||||
type: 'PUSHER_CONNECT'
|
||||
|
||||
@ -171,7 +171,7 @@ class Settings extends React.Component{
|
||||
<input
|
||||
type="text"
|
||||
onChange={ e => this.setState({ pusher_username: e.target.value }) }
|
||||
onBlur={ e => this.props.pusherActions.changeUsername( this.state.pusher_username ) }
|
||||
onBlur={ e => this.props.pusherActions.instruct( 'query', { action: 'change_username', username: this.state.pusher_username }) }
|
||||
value={ this.state.pusher_username } />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user