Skip to content

Commit ec22170

Browse files
committed
Fix list ID parsing in campaign UI
1 parent a2d21a8 commit ec22170

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

frontend/src/Campaign.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,20 +381,31 @@ class TheFormDef extends React.PureComponent {
381381
if (this.props.isSingle && record.lists) {
382382
subLists = record.lists
383383
.map(v => {
384+
// Exclude deleted lists.
384385
return v.id !== 0 ? v.id : null
385386
})
386387
.filter(v => v !== null)
387388
} else if (this.props.route.location.search) {
388-
// list_id in the query params.
389+
// One or more list_id in the query params.
389390
const p = parseUrl.parse(this.props.route.location.search.substring(1))
390391
if (p.hasOwnProperty("list_id")) {
392+
if(Array.isArray(p.list_id)) {
393+
p.list_id.forEach(i => {
394+
// eslint-disable-next-line radix
395+
const id = parseInt(i)
396+
if (id) {
397+
subLists.push(id)
398+
}
399+
});
400+
} else {
391401
// eslint-disable-next-line radix
392402
const id = parseInt(p.list_id)
393403
if (id) {
394404
subLists.push(id)
395405
}
396406
}
397407
}
408+
}
398409

399410
if (this.record) {
400411
this.props.pageTitle(record.name + " / Campaigns")

0 commit comments

Comments
 (0)