From e2970751162c55901f514e4fded950a4604bb546 Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Mon, 11 Mar 2019 11:17:49 -0400 Subject: [PATCH] fix(cloudinary): allow multiple asset selection per field (#2157) --- packages/netlify-cms-media-library-cloudinary/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/netlify-cms-media-library-cloudinary/src/index.js b/packages/netlify-cms-media-library-cloudinary/src/index.js index 44da30ca..62fbaff3 100644 --- a/packages/netlify-cms-media-library-cloudinary/src/index.js +++ b/packages/netlify-cms-media-library-cloudinary/src/index.js @@ -60,7 +60,7 @@ async function init({ options = {}, handleInsert } = {}) { const insertHandler = data => { const assets = data.assets.map(asset => getAssetUrl(asset, resolvedOptions)); - handleInsert(cloudinaryConfig.multiple ? assets : assets[0]); + handleInsert(assets.length > 1 ? assets : assets[0]); }; const mediaLibrary = window.cloudinary.createMediaLibrary(cloudinaryConfig, { insertHandler });