Polishing modal fields and privacy settings

This commit is contained in:
James Barnsley
2018-06-06 21:11:27 +12:00
parent 12054ffcb4
commit 248e476f15
16 changed files with 21418 additions and 23218 deletions

View File

@ -10,10 +10,11 @@ export function setPort(port){
}
}
export function setUsername(username){
export function setUsername(username, force = false){
return {
type: 'PUSHER_SET_USERNAME',
username: username.replace(/[\W_]+/g,'')
username: username.replace(/[\W_]+/g,''),
force: force
}
}

View File

@ -297,6 +297,14 @@ const PusherMiddleware = (function(){
'Could not set username',
error
));
// Forced change to local state, even if server-end failed
// Useful for changing when not yet connected (ie Initial setup on
// non-standard ports, etc)
if (action.force){
response.type = 'PUSHER_USERNAME_CHANGED'
store.dispatch(response)
}
}
);
return next(action);