fix(cloudinary): allow multiple asset selection per field (#2157)

This commit is contained in:
Shawn Erquhart 2019-03-11 11:17:49 -04:00 committed by GitHub
parent b42a9c69db
commit e297075116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 });