Photo browser action: allow to parse the array of photos (#653)

Fix bug that detects a JSON object instead of
an array.

Signed-off-by: Yannick Schaus <github@schaus.net>
pull/661/head
Yannick Schaus 2020-12-17 16:47:14 +01:00 committed by GitHub
parent bf44997fe4
commit 99292f2456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ export const actionsMixin = {
const self = this
let photos = actionConfig[prefix + 'actionPhotos']
let photoBrowserConfig = actionConfig[prefix + 'actionPhotoBrowserConfig']
if (typeof photos === 'string' && photos.startsWith('{')) photos = JSON.parse(photos)
if (typeof photos === 'string' && photos.startsWith('[')) photos = JSON.parse(photos)
if (typeof photoBrowserConfig === 'string' && photoBrowserConfig.startsWith('{')) photoBrowserConfig = JSON.parse(photoBrowserConfig)
if (photos && photos.length > 0) {
const promises = photos.map((el) => {