pitaya-launcher/js/store/actions/launcher.js

27 lines
671 B
JavaScript
Raw Normal View History

2015-09-11 16:25:45 +02:00
var Util = require('../../util');
2015-09-03 15:50:23 +02:00
var RUN_APP = exports.RUN_APP = 'RUN_APP';
var RUN_APP_SUCCESS = exports.RUN_APP_SUCCESS = 'RUN_APP_SUCCESS';
var RUN_APP_FAILED = exports.RUN_APP_FAILED = 'RUN_APP_FAILED';
exports.runApp = function(execPath) {
return function(dispatch, getState) {
dispatch({ type: RUN_APP, execPath: execPath });
2015-09-18 12:13:24 +02:00
return Util.System.runApp(execPath, { clearFreeDesktopFlags: true })
.then(function() {
dispatch({ type: RUN_APP_SUCCESS, execPath: execPath });
return execPath;
})
.catch(function(err) {
dispatch({ type: RUN_APP_FAILED, error: err });
return err;
})
;
};
2015-09-03 15:50:23 +02:00
};