Polishing modal fields and privacy settings
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
|
||||
import ReactGA from 'react-ga'
|
||||
import Mopidy from 'mopidy'
|
||||
import md5 from 'md5';
|
||||
import { hashHistory } from 'react-router'
|
||||
import * as helpers from '../../helpers'
|
||||
|
||||
@ -221,7 +222,8 @@ const MopidyMiddleware = (function(){
|
||||
|
||||
case 'MOPIDY_CONNECTED':
|
||||
if (store.getState().ui.allow_reporting){
|
||||
ReactGA.event({ category: 'Mopidy', action: 'Connected', label: window.location.hostname });
|
||||
var hashed_hostname = md5(window.location.hostname);
|
||||
ReactGA.event({ category: 'Mopidy', action: 'Connected', label: hashed_hostname });
|
||||
}
|
||||
next(action);
|
||||
break;
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user