Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
fix: enabled system triggers have empty condition
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmt committed Jan 2, 2020
1 parent e38f4e3 commit 34466f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ func (cfg *config) merge(other *config) *config {
}
for _, item := range other.Triggers {
if existing, ok := triggersMap[item.Name]; ok {
existing.Condition = coalesce(item.Condition)
existing.Template = coalesce(item.Template)
existing.Condition = coalesce(item.Condition, existing.Condition)
existing.Template = coalesce(item.Template, existing.Template)
if item.Enabled != nil {
existing.Enabled = item.Enabled
}
Expand All @@ -240,8 +240,8 @@ func (cfg *config) merge(other *config) *config {
}
for _, item := range other.Templates {
if existing, ok := templatesMap[item.Name]; ok {
existing.Body = coalesce(item.Body)
existing.Title = coalesce(item.Title)
existing.Body = coalesce(item.Body, existing.Body)
existing.Title = coalesce(item.Title, existing.Title)
templatesMap[item.Name] = existing
} else {
templatesMap[item.Name] = item
Expand Down

0 comments on commit 34466f3

Please sign in to comment.