From 88d8fa56fb613e0b890d9de4820c57b8b13b0f3e Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Tue, 10 Jun 2025 07:43:34 +0100 Subject: [PATCH] Make auto-invert work with prefixed icons --- internal/glance/config-fields.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/glance/config-fields.go b/internal/glance/config-fields.go index d368140..1527c72 100644 --- a/internal/glance/config-fields.go +++ b/internal/glance/config-fields.go @@ -141,13 +141,13 @@ func newCustomIconField(value string) customIconField { const autoInvertPrefix = "auto-invert " field := customIconField{} + if strings.HasPrefix(value, autoInvertPrefix) { + field.IsFlatIcon = true + value = strings.TrimPrefix(value, autoInvertPrefix) + } + prefix, icon, found := strings.Cut(value, ":") if !found { - if strings.HasPrefix(value, autoInvertPrefix) { - field.IsFlatIcon = true - value = strings.TrimPrefix(value, autoInvertPrefix) - } - field.URL = template.URL(value) return field }