Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Fix list ID parsing in campaign UI

Kailash Nadhec2217017690
diff --git a/frontend/src/Campaign.js b/frontend/src/Campaign.js
index fc0a7f2c..57dcb7b8 100644
--- a/frontend/src/Campaign.js
+++ b/frontend/src/Campaign.js
@@ -381,13 +381,23 @@ class TheFormDef extends React.PureComponent {
if (this.props.isSingle && record.lists) {
subLists = record.lists
.map(v => {
+ // Exclude deleted lists.
return v.id !== 0 ? v.id : null
})
.filter(v => v !== null)
} else if (this.props.route.location.search) {
- // list_id in the query params.
+ // One or more list_id in the query params.
const p = parseUrl.parse(this.props.route.location.search.substring(1))
if (p.hasOwnProperty("list_id")) {
+ if(Array.isArray(p.list_id)) {
+ p.list_id.forEach(i => {
+ // eslint-disable-next-line radix
+ const id = parseInt(i)
+ if (id) {
+ subLists.push(id)
+ }
+ });
+ } else {
// eslint-disable-next-line radix
const id = parseInt(p.list_id)
if (id) {
@@ -395,6 +405,7 @@ class TheFormDef extends React.PureComponent {
}
}
}
+ }
if (this.record) {
this.props.pageTitle(record.name + " / Campaigns")