Skip to content

Commit

Permalink
Prevent campaign details being edited during send (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
pushchris authored Jan 25, 2025
1 parent c24e37c commit 1527e01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/platform/src/queue/RedisQueueProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class RedisQueueProvider implements QueueProvider {

constructor({ concurrency, ...config }: RedisQueueConfig, queue: Queue) {
this.queue = queue
this.concurrency = concurrency
this.concurrency = concurrency ?? 10
this.redis = DefaultRedis(config, {
maxRetriesPerRequest: null,
})
Expand Down
4 changes: 3 additions & 1 deletion apps/ui/src/views/campaign/CampaignOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export default function CampaignOverview() {
)?.reduce((prev, curr) => prev ? [prev, ', ', curr] : curr, '') ?? '–'
}

const canEdit = campaign.type === 'trigger' || campaign.state === 'draft' || campaign.state === 'aborted'

const extra = campaign.channel === 'text'
? '"phone": "+12345678900",'
: campaign.channel === 'push'
Expand Down Expand Up @@ -57,7 +59,7 @@ export default function CampaignOverview() {
title={t('details')}
size="h3"
actions={
<Button
canEdit && <Button
size="small"
variant="secondary"
onClick={() => setIsEditOpen(true)}
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/advanced/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Find below a list of all environment variables that can be set at launch to conf
| DB_DATABASE | string | true |

### Queue
| key | type | required |
| key | type | required | notes
|--|--|--|
| QUEUE_DRIVER | 'sqs' or 'redis' or 'memory' | true |
| AWS_SQS_QUEUE_URL | string | If driver is SQS |
Expand All @@ -28,6 +28,7 @@ Find below a list of all environment variables that can be set at launch to conf
| REDIS_HOST | string | If driver is Redis |
| REDIS_PORT | string | If driver is Redis |
| REDIS_TLS | boolean | false |
| REDIS_CONCURRENCY | number | false | number of concurrent jobs to run


### Redis
Expand Down

0 comments on commit 1527e01

Please sign in to comment.