Skip to content

Commit

Permalink
more lint
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Jan 18, 2024
1 parent 4b6e7e6 commit 32e9a60
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/unpackerr/tray.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

// Safety constant.
const hist = "hist_"
const histNone = "hist_none"

// startTray Run()s readyTray to bring up the web server and the GUI app.
func (u *Unpackerr) startTray() {
Expand Down Expand Up @@ -142,12 +143,12 @@ func (u *Unpackerr) watchGuiChannels() {
func (u *Unpackerr) makeHistoryChannels() {
history := systray.AddMenuItem("History", fmt.Sprintf("display last %d items queued", u.KeepHistory))
u.menu["history"] = ui.WrapMenu(history)
u.menu[hist+"none"] = ui.WrapMenu(history.AddSubMenuItem("-- there is no history --", "nothing has been queued yet"))
u.menu[hist+"none"].Disable()
u.menu[histNone] = ui.WrapMenu(history.AddSubMenuItem("-- there is no history --", "nothing has been queued yet"))
u.menu[histNone].Disable()

if u.KeepHistory == 0 {
u.menu[hist+"none"].SetTitle("-- history disabled --")
u.menu[hist+"none"].SetTooltip("history is disabled in the config")
u.menu[histNone].SetTitle("-- history disabled --")
u.menu[histNone].SetTooltip("history is disabled in the config")
}

for i := 0; i < int(u.KeepHistory); i++ {
Expand Down Expand Up @@ -261,7 +262,7 @@ func (u *Unpackerr) updateHistory(item string) {
}

if ui.HasGUI() && item != "" {
u.menu[hist+"none"].Hide()
u.menu[histNone].Hide()
}

// u.History.Items is a slice with a set (identical) length and capacity.
Expand Down

0 comments on commit 32e9a60

Please sign in to comment.