mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-09-01 12:26:08 +08:00
fix: prevent draft campaigns from changing state based on activity
This commit is contained in:
parent
5519cf3f0d
commit
71e396de65
1 changed files with 1 additions and 0 deletions
|
@ -523,6 +523,7 @@ export const campaignDeliveryProgress = async (campaignId: number): Promise<Camp
|
|||
export const updateCampaignProgress = async (campaign: Campaign): Promise<void> => {
|
||||
const currentState = (pending: number, delivery: CampaignDelivery) => {
|
||||
if (campaign.type === 'trigger') return 'running'
|
||||
if (campaign.state === 'draft') return 'draft'
|
||||
if (campaign.state === 'loading') return 'loading'
|
||||
if (pending <= 0) return 'finished'
|
||||
if (delivery.sent === 0) return 'scheduled'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue