fix(uploadcare): allow to be Uploadcare to be used in list widget (#1774)
This commit is contained in:
parent
f22c4dbd96
commit
deaac3d78b
@ -1,4 +1,5 @@
|
|||||||
import { loadScript } from 'netlify-cms-lib-util';
|
import { loadScript } from 'netlify-cms-lib-util';
|
||||||
|
import { Iterable } from 'immutable';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Uploadcare widget configuration, can be overriden via config.yml.
|
* Default Uploadcare widget configuration, can be overriden via config.yml.
|
||||||
@ -44,7 +45,7 @@ function getFileGroup(files) {
|
|||||||
* because the value we're returning may be a promise that we created.
|
* because the value we're returning may be a promise that we created.
|
||||||
*/
|
*/
|
||||||
function getFiles(value, cdnBase) {
|
function getFiles(value, cdnBase) {
|
||||||
if (typeof value === 'object') {
|
if (Array.isArray(value) || Iterable.isIterable(value)) {
|
||||||
const arr = Array.isArray(value) ? value : value.toJS();
|
const arr = Array.isArray(value) ? value : value.toJS();
|
||||||
return isFileGroup(arr) ? getFileGroup(arr) : arr.map(val => getFile(val, cdnBase));
|
return isFileGroup(arr) ? getFileGroup(arr) : arr.map(val => getFile(val, cdnBase));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user