Tidying connections; Move into indexed connections

This commit is contained in:
James Barnsley
2017-02-18 22:25:26 +13:00
parent b1af53fed9
commit 252d031238
2 changed files with 3 additions and 6 deletions

View File

@ -89,7 +89,7 @@ const PusherMiddleware = (function(){
);
socket.onopen = () => {
store.dispatch({ type: 'PUSHER_CONNECTED', connection: connection });
store.dispatch({ type: 'PUSHER_CONNECTED', connection_id: connection.connection_id });
store.dispatch({ type: 'PUSHER_SET_USERNAME', username: connection.username });
};

View File

@ -7,11 +7,8 @@ export default function reducer(pusher = {}, action){
return Object.assign({}, pusher, { connected: false, connecting: true });
case 'PUSHER_CONNECTED':
return Object.assign({}, pusher, {
connected: true,
connecting: false,
connection_id: action.connection.connection_id,
username: action.connection.username
return Object.assign({}, pusher, {
connection_id: action.connection_id
});
case 'PUSHER_DISCONNECTED':