Country/Locale now settable via config (fixes #19); New get_config endpoint for Pusher

This commit is contained in:
James Barnsley
2017-02-06 10:07:32 +13:00
parent f3a409b356
commit 94c947e90e
10 changed files with 53 additions and 17 deletions

View File

@ -103,12 +103,6 @@ const PusherMiddleware = (function(){
socket.onopen = () => {
store.dispatch({ type: 'PUSHER_CONNECTED', connection: connection });
store.dispatch({ type: 'PUSHER_SET_USERNAME', username: connection.username });
request({ action: 'get_radio' })
.then(
response => {
store.dispatch({ type: 'RADIO', data: response.data })
}
)
};
socket.onmessage = (message) => {
@ -119,12 +113,24 @@ const PusherMiddleware = (function(){
break;
case 'PUSHER_CONNECTED':
request({ action: 'get_config' })
.then(
response => {
store.dispatch({ type: 'CONFIG', data: response.data })
}
)
request({ action: 'get_version' })
.then(
response => {
store.dispatch({ type: 'VERSION', data: response.data })
}
)
request({ action: 'get_radio' })
.then(
response => {
store.dispatch({ type: 'RADIO', data: response.data })
}
)
return next(action);
break;