Testing restarter
This commit is contained in:
@ -31,7 +31,13 @@ export function disconnect(){
|
||||
|
||||
export function startUpgrade(){
|
||||
return {
|
||||
type: 'START_UPGRADE'
|
||||
type: 'PUSHER_START_UPGRADE'
|
||||
}
|
||||
}
|
||||
|
||||
export function restartMopidy(){
|
||||
return {
|
||||
type: 'PUSHER_RESTART_MOPIDY'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -270,16 +270,9 @@ const PusherMiddleware = (function(){
|
||||
request(store, 'upgrade')
|
||||
.then(
|
||||
response => {
|
||||
if (response.upgrade_successful){
|
||||
store.dispatch(uiActions.createNotification({content: 'Upgrade complete'}));
|
||||
} else {
|
||||
store.dispatch(uiActions.createNotification({content: 'Upgrade failed, please upgrade manually', type: 'bad'}));
|
||||
}
|
||||
|
||||
response.type = 'PUSHER_VERSION'
|
||||
store.dispatch(response)
|
||||
store.dispatch(uiActions.createNotification({content: response.message}));
|
||||
},
|
||||
error => {
|
||||
error => {
|
||||
store.dispatch(coreActions.handleException(
|
||||
'Could not start upgrade',
|
||||
error
|
||||
@ -503,6 +496,11 @@ const PusherMiddleware = (function(){
|
||||
window.location.reload(true);
|
||||
break
|
||||
|
||||
case 'PUSHER_RESTART_MOPIDY':
|
||||
store.dispatch(uiActions.createNotification({content: 'Restarting Mopidy...'}));
|
||||
request(store, 'restart');
|
||||
break
|
||||
|
||||
case 'PUSHER_VERSION':
|
||||
ReactGA.event({ category: 'Pusher', action: 'Version', label: action.version.current })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user