diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-02 16:30:54 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-02 16:30:54 +0200 |
| commit | 1b4a9fab63ce3339c67925f3a7136707ed25d227 (patch) | |
| tree | af0e1037fcf11e24653322aaed6b01ebdc492fb9 /app/client/modules/samplernn/samplernn.actions.js | |
| parent | 65245a8251c728feb39a94455d850fc27cc5abfe (diff) | |
whmmm
Diffstat (limited to 'app/client/modules/samplernn/samplernn.actions.js')
| -rw-r--r-- | app/client/modules/samplernn/samplernn.actions.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/client/modules/samplernn/samplernn.actions.js b/app/client/modules/samplernn/samplernn.actions.js index da39db9..61a3b98 100644 --- a/app/client/modules/samplernn/samplernn.actions.js +++ b/app/client/modules/samplernn/samplernn.actions.js @@ -88,7 +88,9 @@ export const load_directories = () => (dispatch) => { file.log = lines .map(s => s.split('\t').map(s => - s.split(': ').reduce((a,b) => (a[b[0]] = b[1])&&a, {}) + s.split(': ') + .filter(b => b.length && b[1]) + .reduce((a,b) => (a[b[0]] = b[1])&&a, {}) ) ) }) @@ -104,10 +106,12 @@ export const load_directories = () => (dispatch) => { // report }, }) - dispatch({ - type: types.samplernn.set_folder, - folder: folders[0].name, - }) + if (folders.length) { + dispatch({ + type: types.samplernn.set_folder, + folder: folders[0].name, + }) + } }).catch(e => { console.error(e) }) |
