diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-03 20:12:56 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-03 20:12:56 +0200 |
| commit | 02dc913860b162991db7fb0e2015a76570fbf33e (patch) | |
| tree | ef857ef82086174377772073c02bf2eb600e5005 /public/bundle.js | |
| parent | e21538fe99277d31cacde6f8596a24156faaefd7 (diff) | |
create these datasets
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 92 |
1 files changed, 57 insertions, 35 deletions
diff --git a/public/bundle.js b/public/bundle.js index 4b68572..61bf865 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -5005,7 +5005,7 @@ var SampleRNNDatasets = function (_Component) { ); } console.log(samplernn); - if (!samplernn.data.folder || !samplernn.data.folders.length) { + if (!samplernn.data.folders.length) { console.log('no folders, redirect to /new'); return history.push('/samplernn/new/'); } @@ -5014,30 +5014,7 @@ var SampleRNNDatasets = function (_Component) { console.log(folder); if (!folder || !folder.name) return; console.log(folder.name); - return (0, _preact.h)( - 'div', - { className: 'app' }, - (0, _preact.h)( - 'div', - { 'class': 'heading' }, - (0, _preact.h)( - 'h1', - null, - folder.name - ) - ), - folder.name !== 'unsorted' && (0, _preact.h)(_dataset2.default, { - title: 'Add Files', - module: samplernnModule, - folder: folder, - canUpload: true, canAddURL: true - }), - this.renderDataset() - ); - } - }, { - key: 'renderDataset', - value: function renderDataset() { + return (0, _preact.h)( 'div', { 'class': 'rows params datasets' }, @@ -5221,12 +5198,26 @@ var SampleRNNImport = function (_Component) { value: function render() { var _this2 = this; - return (0, _preact.h)(_samplernn3.default, { - id: 'unsorted', - beforeRow: function beforeRow(row) { - return _this2.beforeRow(row); - } - }); + return (0, _preact.h)( + 'div', + { className: 'app' }, + (0, _preact.h)( + 'div', + { 'class': 'heading' }, + (0, _preact.h)( + 'h1', + null, + 'import' + ) + ), + (0, _preact.h)(_samplernn3.default, { + id: 'unsorted', + history: this.props.history, + beforeRow: function beforeRow(row) { + return _this2.beforeRow(row); + } + }) + ); } }, { key: 'beforeRow', @@ -5799,6 +5790,7 @@ var samplernnReducer = function samplernnReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : samplernnInitialState; var action = arguments[1]; + console.log(action.type); switch (action.type) { case _types2.default.samplernn.init: return _extends({}, state, { @@ -6165,9 +6157,37 @@ var SampleRNNShow = function (_Component) { _createClass(SampleRNNShow, [{ key: 'render', value: function render() { - return (0, _preact.h)(_samplernn3.default, { - id: this.props.match.params.id - }); + var _props = this.props, + samplernn = _props.samplernn, + match = _props.match, + history = _props.history; + + var _ref = samplernn || {}, + folder = _ref.folder; + + console.log(folder); + return (0, _preact.h)( + 'div', + { className: 'app' }, + (0, _preact.h)( + 'div', + { 'class': 'heading' }, + (0, _preact.h)( + 'h1', + null, + folder ? folder.name : 'Loading...' + ) + ), + folder && folder.name !== 'unsorted' && (0, _preact.h)(_dataset2.default, { + title: 'Add Files', + module: samplernnModule, + folder: folder, + canUpload: true, canAddURL: true + }), + (0, _preact.h)(_samplernn3.default, { + id: this.props.match.params.id + }) + ); } }]); @@ -6175,7 +6195,9 @@ var SampleRNNShow = function (_Component) { }(_preact.Component); var mapStateToProps = function mapStateToProps(state) { - return {}; + return { + samplernn: state.module.samplernn + }; }; var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { |
