Skip to content

Commit

Permalink
Let launcher choose debug icon when running in non-prod (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ Barrett authored Feb 6, 2023
1 parent c0e0cdb commit 1095f6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions ee/desktop/menu/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import (
type menuIcon string

const (
KolideDesktopIcon = "kolide-desktop"
KolideDebugDesktopIcon = "kolide-debug-desktop"
KolideDesktopIcon = "kolide-desktop"
)

// MenuData encapsulates a menu bar icon and accessible menu items
Expand Down
2 changes: 1 addition & 1 deletion ee/desktop/menu/menu_parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func Test_ParseMenuData(t *testing.T) {
{
name: "happy path",
data: &MenuData{
Icon: KolideDebugDesktopIcon,
Icon: KolideDesktopIcon,
Tooltip: "Kolide",
},
},
Expand Down
9 changes: 6 additions & 3 deletions ee/desktop/menu/menu_systray.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ func (m *menu) Build() {
func (m *menu) SetIcon(icon menuIcon) {
switch icon {
case KolideDesktopIcon:
systray.SetTemplateIcon(assets.KolideDesktopIcon, assets.KolideDesktopIcon)
case KolideDebugDesktopIcon:
systray.SetTemplateIcon(assets.KolideDebugDesktopIcon, assets.KolideDebugDesktopIcon)
// Allow launcher to conditionally choose the launcher icon based on whether we're running in production or not
if m.isProd() {
systray.SetTemplateIcon(assets.KolideDesktopIcon, assets.KolideDesktopIcon)
} else {
systray.SetTemplateIcon(assets.KolideDebugDesktopIcon, assets.KolideDebugDesktopIcon)
}
default:
level.Debug(m.logger).Log(
"msg", "invalid icon",
Expand Down

0 comments on commit 1095f6f

Please sign in to comment.