Fixing pusher name set

This commit is contained in:
James Barnsley
2016-12-16 14:31:43 +13:00
parent 5a5b48c93a
commit d4ea455b92
3 changed files with 2 additions and 10 deletions

View File

@ -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(

View File

@ -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'

View File

@ -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>