Skip to content

Commit

Permalink
check for pending category
Browse files Browse the repository at this point in the history
  • Loading branch information
rxdn committed Nov 6, 2024
1 parent 11a2e18 commit 8c7abd1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,17 @@ func (d *Daemon) RunOnce() {
continue
}

// If there is no pending category set, then disable the feature
if panel.PendingCategory == nil {
d.logger.Debug("No pending category set", zap.Uint64("guild_id", ticket.GuildId), zap.Int("ticket_id", ticket.TicketId))
continue
}

var newCategoryId uint64
switch ticket.NewStatus {
case model.TicketStatusOpen:
newCategoryId = panel.TargetCategory
case model.TicketStatusPending:
if panel.PendingCategory == nil {
d.logger.Debug("No pending category set", zap.Uint64("guild_id", ticket.GuildId), zap.Int("ticket_id", ticket.TicketId))
continue
}

newCategoryId = *panel.PendingCategory
}

Expand Down

0 comments on commit 8c7abd1

Please sign in to comment.