From 593d0eaa2eafcb36337d029b72b886c614bb5d9a Mon Sep 17 00:00:00 2001 From: Alex Pliutau Date: Tue, 23 Jul 2024 21:29:53 +0200 Subject: [PATCH] Fix hanging when opening a blacklist --- cli/commands.go | 1 - cli/model.go | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/commands.go b/cli/commands.go index ce53e1d..8f58bf6 100644 --- a/cli/commands.go +++ b/cli/commands.go @@ -44,7 +44,6 @@ var commandConfigureBlacklist = command{ Name: "blacklist", Desc: "Configure blacklist.", Run: func(m model) model { - m.commandsListSelection = 0 m.state = blacklistView m.textarea.SetValue(strings.Join(m.domains, "\n")) m.textarea.Focus() diff --git a/cli/model.go b/cli/model.go index 9565796..10189a8 100644 --- a/cli/model.go +++ b/cli/model.go @@ -49,7 +49,7 @@ func (m model) Init() tea.Cmd { return tea.Quit } - return nil + return textarea.Blink } func (m *model) getCommmandsList() []command { @@ -102,6 +102,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, tea.Quit } + m.commandsListSelection = 0 m.domains = domains m.state = menuView m.textarea.Blur()