From 25e19cfe4f69ae8e6b481122f398a8234e295226 Mon Sep 17 00:00:00 2001 From: abs3nt Date: Tue, 10 Jan 2023 14:04:00 -0800 Subject: [PATCH] tea --- internal/tui/device.go | 2 +- internal/tui/list.go | 2 +- internal/tui/main.go | 2 +- internal/tui/playlists.go | 2 +- internal/tui/playlisttracks.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/tui/device.go b/internal/tui/device.go index aaf57ae..9414e58 100644 --- a/internal/tui/device.go +++ b/internal/tui/device.go @@ -40,7 +40,7 @@ func (m deviceModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: if msg.String() == "ctrl+c" { - os.Exit(0) + return m, tea.Quit } if msg.String() == "enter" { device := m.list.SelectedItem() diff --git a/internal/tui/list.go b/internal/tui/list.go index ffdb70b..d066d44 100644 --- a/internal/tui/list.go +++ b/internal/tui/list.go @@ -78,7 +78,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } } if msg.String() == "ctrl+c" { - os.Exit(0) + return m, tea.Quit } if msg.String() == "ctrl+r" { track := m.list.SelectedItem() diff --git a/internal/tui/main.go b/internal/tui/main.go index 0b40edf..0cbc269 100644 --- a/internal/tui/main.go +++ b/internal/tui/main.go @@ -58,7 +58,7 @@ func (m mainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: if msg.String() == "ctrl+c" || msg.String() == "q" || msg.String() == "esc" { - os.Exit(0) + return m, tea.Quit } if msg.String() == "enter" { switch m.list.SelectedItem().(mainItem).SpotifyItem.(type) { diff --git a/internal/tui/playlists.go b/internal/tui/playlists.go index bad0fb6..ca9c95b 100644 --- a/internal/tui/playlists.go +++ b/internal/tui/playlists.go @@ -63,7 +63,7 @@ func (m playlistModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: if msg.String() == "ctrl+c" { - os.Exit(0) + return m, tea.Quit } if msg.String() == "enter" { playlist := m.list.SelectedItem().(playlistItem).SimplePlaylist diff --git a/internal/tui/playlisttracks.go b/internal/tui/playlisttracks.go index a25b332..9984e86 100644 --- a/internal/tui/playlisttracks.go +++ b/internal/tui/playlisttracks.go @@ -77,7 +77,7 @@ func (m playlistTracksModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } } if msg.String() == "ctrl+c" { - os.Exit(0) + return m, tea.Quit } if msg.String() == "ctrl+r" { track := m.list.SelectedItem()