diff options
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 92 |
1 files changed, 90 insertions, 2 deletions
diff --git a/public/bundle.js b/public/bundle.js index 25ea2da..8ce535e 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -6178,7 +6178,16 @@ var samplernnReducer = function samplernnReducer() { old_dataset = void 0, folder = void 0, old_folder = void 0; - var dataset_name = action.data.name.split('.')[0]; + var dataset_name = void 0; + if (action.data.dataset) { + dataset_name = action.data.dataset; + } else if (action.data.name) { + dataset_name = action.data.name.split('.')[0]; + } else if (action.data.url) { + dataset_name = action.data.url; + } else { + dataset_name = null; + } if (dataset_name in state.data.datasetLookup) { old_dataset = state.data.datasetLookup[dataset_name]; dataset = _extends({}, old_dataset, { @@ -6214,9 +6223,33 @@ var samplernnReducer = function samplernnReducer() { case _types2.default.file.update: if (action.data.module === 'samplernn') { + var _extends6; + + var _old_dataset = void 0; + var new_dataset = state.data.datasetLookup[action.data.dataset]; + var old_file = state.data.fileLookup[action.data.id]; + var new_dataset_update = void 0; + if (old_file && action.data.dataset !== old_file.dataset) { + if (state.data.datasetLookup[old_file.dataset]) { + _old_dataset = state.data.datasetLookup[old_file.dataset]; + old_dataset_update = _extends({}, _old_dataset, { + input: _old_dataset.input.filter(function (id) { + return id !== action.data.id; + }), + output: _old_dataset.output.filter(function (id) { + return id !== action.data.id; + }) + }); + } + new_dataset_update = _extends({}, new_dataset, { + input: action.data.generated ? [] : [action.data.id], + output: !action.data.generated ? [] : [action.data.id] + }); + } return _extends({}, state, { loading: false, data: _extends({}, state.data, { + datasetLookup: _old_dataset ? _extends({}, state.data.datasetLookup, (_extends6 = {}, _defineProperty(_extends6, _old_dataset.name, old_dataset_update), _defineProperty(_extends6, new_dataset.name, new_dataset_update), _extends6)) : new_dataset_update ? _extends({}, state.data.datasetLookup, _defineProperty({}, new_dataset.name, new_dataset_update)) : state.data.datasetLookup, fileLookup: _extends({}, state.data.fileLookup, _defineProperty({}, action.data.id, action.data)) }) }); @@ -6995,6 +7028,10 @@ var _socket5 = __webpack_require__(/*! ./socket.task */ "./app/client/socket/soc var task = _interopRequireWildcard(_socket5); +var _socket6 = __webpack_require__(/*! ./socket.api */ "./app/client/socket/socket.api.js"); + +var api = _interopRequireWildcard(_socket6); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7004,7 +7041,8 @@ exports.default = { actions: actions, system: system, live: live, - task: task + task: task, + api: api }; @@ -7097,6 +7135,56 @@ var syscall_async = exports.syscall_async = function syscall_async(tag, payload) /***/ }), +/***/ "./app/client/socket/socket.api.js": +/*!*****************************************!*\ + !*** ./app/client/socket/socket.api.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _store = __webpack_require__(/*! ../store */ "./app/client/store.js"); + +var _types = __webpack_require__(/*! ../types */ "./app/client/types.js"); + +var _types2 = _interopRequireDefault(_types); + +var _socket = __webpack_require__(/*! ./socket.connection */ "./app/client/socket/socket.connection.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_socket.socket.on('api_res', function (data) { + // console.log('system response', data) + var type = _types2.default[data.datatype]; + if (!type) return console.error('socket:api_res bad datatype', data.datatype); + switch (data.type) { + case 'create': + return (0, _store.dispatch)({ + type: type.create, + source: 'socket', + data: data.data + }); + case 'update': + return (0, _store.dispatch)({ + type: type.update, + source: 'socket', + data: data.data + }); + case 'destroy': + return (0, _store.dispatch)({ + type: type.destroy, + source: 'socket', + data: data.data + }); + default: + break; + } +}); + +/***/ }), + /***/ "./app/client/socket/socket.connection.js": /*!************************************************!*\ !*** ./app/client/socket/socket.connection.js ***! |
