Skip to content

Commit 51c644e

Browse files
committed
🐛 Fix iconize in template
1 parent 4482c16 commit 51c644e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Sources/Model/EventTransformer.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ class EventTransformer {
1616
for rule in rules where event.title.label.range(
1717
of: rule.regex, options: .regularExpression
1818
) != nil {
19-
return event |> (Event.titleLens * Title.iconLens) *~ rule.icon
19+
let withIcon = event
20+
|> (Event.titleLens * Title.iconLens) *~ rule.icon
21+
let withFull = withIcon
22+
|> (Event.titleLens * Title.fullLens) *~ "\(rule.icon) \(event.title.full)"
23+
return withFull
2024
}
2125
return event
2226
}

Sources/Model/Title.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,13 @@ extension Title {
8989
icon: icon
9090
) }
9191
)
92+
93+
static let fullLens = Lens<Title, String>(
94+
get: { title in title.full },
95+
set: { full, title in Title(
96+
full: full,
97+
label: title.label,
98+
icon: title.icon
99+
) }
100+
)
92101
}

0 commit comments

Comments
 (0)