diff options
Diffstat (limited to 'app/client/modules/biggan/biggan.actions.js')
| -rw-r--r-- | app/client/modules/biggan/biggan.actions.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/client/modules/biggan/biggan.actions.js b/app/client/modules/biggan/biggan.actions.js index f09510c..10d36ff 100644 --- a/app/client/modules/biggan/biggan.actions.js +++ b/app/client/modules/biggan/biggan.actions.js @@ -181,6 +181,7 @@ export const load_results = (id) => (dispatch) => { export const load_encodings = () => dispatch => { const module = bigganModule.name + console.log(actions) util.allProgress([ actions.folder.index({ module }), actions.file.index({ @@ -188,8 +189,10 @@ export const load_encodings = () => dispatch => { datatype: 'image', generated: 1, }), - ], (folders, files) => { - console.log(folders, files) + ], (percent, i, n) => { + // loading function + }).then(res => { + const [folders, files] = res const folder_name_lookup = {} const encodings = {} folders.forEach(folder => { @@ -197,19 +200,17 @@ export const load_encodings = () => dispatch => { encodings[folder.name] = [] }) files.forEach(file => { - folder_name = folder_name_lookup[file.folder_id] + const folder_name = folder_name_lookup[file.folder_id] encodings[folder_name].push(file) }) folders.forEach(folder => { if (!encodings[folder.name].length) { - delete encodings[folder_name] + delete encodings[folder.name] } }) dispatch({ type: types.biggan.load_encodings, encodings }) - }) } - |
