Skip to content

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

Fix campaign start throwing error when disabling schedule on the UI.

Kailash Nadh251c1ea64fb7
diff --git a/frontend/src/views/Campaign.vue b/frontend/src/views/Campaign.vue
index 722aa4c4..80a451d9 100644
--- a/frontend/src/views/Campaign.vue
+++ b/frontend/src/views/Campaign.vue
@@ -406,12 +406,7 @@ export default Vue.extend({
// Starts or schedule a campaign.
startCampaign() {
- let status = '';
- if (this.canStart) {
- status = 'running';
- } else if (this.canSchedule) {
- status = 'scheduled';
- } else {
+ if (!this.canStart && !this.canSchedule) {
return;
}
@@ -420,6 +415,15 @@ export default Vue.extend({
// First save the campaign.
this.updateCampaign().then(() => {
// Then start/schedule it.
+ let status = '';
+ if (this.canStart) {
+ status = 'running';
+ } else if (this.canSchedule) {
+ status = 'scheduled';
+ } else {
+ return;
+ }
+
this.$api.changeCampaignStatus(this.data.id, status).then(() => {
this.$router.push({ name: 'campaigns' });
});