Fix two highlighted fields in the add dialog when unmonitoring

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 20:13:11 +02:00
co-authored by Claude Sonnet 5.5
parent 76750cadf6
commit a7d74e2097
3 changed files with 92 additions and 14 deletions
+2 -14
View File
@@ -315,26 +315,14 @@ func (v *searchView) add(i int) {
// "Search now" only makes sense when something will be monitored.
monitored := form.GetFormItemByLabel(lMonitor).(*tview.Checkbox)
searchNow := form.GetFormItemByLabel(lSearch).(*tview.Checkbox)
wantSearch := true
searchable := func() bool {
if !monitored.IsChecked() {
return false
}
return len(modes) == 0 || modes[selected(form, lEpisode)].value != sonarr.MonitorNone
}
syncSearch := func() {
if searchable() {
searchNow.SetDisabled(false)
searchNow.SetChecked(wantSearch)
return
}
searchNow.SetDisabled(true)
searchNow.SetChecked(false)
}
searchNow.SetChangedFunc(func(checked bool) {
if searchable() {
wantSearch = checked
}
syncSearch := bindSearchNow(searchNow, searchable, func() {
v.app.Notify(levelWarn, "Search now needs something to be monitored")
})
monitored.SetChangedFunc(func(bool) { syncSearch() })
if len(modes) > 0 {