From deaac3d78b5fa1cbd79ab042168c9cd5daa196b7 Mon Sep 17 00:00:00 2001 From: Aleksandr Grenishin Date: Wed, 24 Oct 2018 04:47:53 +0300 Subject: [PATCH] fix(uploadcare): allow to be Uploadcare to be used in list widget (#1774) --- packages/netlify-cms-media-library-uploadcare/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/netlify-cms-media-library-uploadcare/src/index.js b/packages/netlify-cms-media-library-uploadcare/src/index.js index c6d536e5..cecde0db 100644 --- a/packages/netlify-cms-media-library-uploadcare/src/index.js +++ b/packages/netlify-cms-media-library-uploadcare/src/index.js @@ -1,4 +1,5 @@ import { loadScript } from 'netlify-cms-lib-util'; +import { Iterable } from 'immutable'; /** * 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. */ function getFiles(value, cdnBase) { - if (typeof value === 'object') { + if (Array.isArray(value) || Iterable.isIterable(value)) { const arr = Array.isArray(value) ? value : value.toJS(); return isFileGroup(arr) ? getFileGroup(arr) : arr.map(val => getFile(val, cdnBase)); }