Fixed install state.

This commit is contained in:
Wyatt Johnson
2017-02-07 14:30:25 -07:00
parent fd40135f1b
commit 4e1891c068
3 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -95,10 +95,10 @@ const checkInstallFailure = error => ({type: actions.CHECK_INSTALL_FAILURE, erro
export const checkInstall = next => dispatch => {
dispatch(checkInstallRequest());
coralApi('/setup/available')
.then(({available}) => {
dispatch(checkInstallSuccess(available));
if (!available) {
coralApi('/setup')
.then(({installed}) => {
dispatch(checkInstallSuccess(installed));
if (installed) {
next();
}
})
+1 -1
View File
@@ -84,7 +84,7 @@ export default function install (state = initialState, action) {
});
case actions.CHECK_INSTALL_SUCCESS:
return state
.set('alreadyInstalled', !action.available);
.set('alreadyInstalled', action.installed);
default :
return state;
}
+3 -3
View File
@@ -4,14 +4,14 @@ const SetupService = require('../../../services/setup');
const router = express.Router();
router.get('/available', (req, res, next) => {
router.get('/', (req, res, next) => {
SetupService
.isAvailable()
.then(() => {
res.json({available: true});
res.json({installed: false});
})
.catch(() => {
res.json({available: false});
res.json({installed: true});
});
});