diff --git a/internal/ui_main_events.go b/internal/ui_main_events.go index d308a57..22f9262 100644 --- a/internal/ui_main_events.go +++ b/internal/ui_main_events.go @@ -13,7 +13,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, tea.Quit case "enter": - if m.loaded { + if m.width != 0 { // Process the selected item, if the return value is true then exit the application if m.processSelection() { return m, tea.Quit @@ -33,13 +33,11 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } } case tea.WindowSizeMsg: - if !m.loaded { + if m.width == 0 { // Initialize the static lists and make sure the content // does not extend past the screen m.initLists(msg.Width, msg.Height) - // Set model loaded to true - m.loaded = true } else { // Else we are loaded and will update the sizing on the fly m.height = msg.Height diff --git a/internal/ui_main_view.go b/internal/ui_main_view.go index f9a6e0c..247262d 100644 --- a/internal/ui_main_view.go +++ b/internal/ui_main_view.go @@ -10,7 +10,7 @@ import ( ) func (m model) View() string { - if m.loaded { + if m.width != 0 { title := "" switch m.focused { case INTRO: diff --git a/internal/ui_model.go b/internal/ui_model.go index bbe3549..31bf881 100644 --- a/internal/ui_model.go +++ b/internal/ui_model.go @@ -24,7 +24,6 @@ type model struct { lists []list.Model gpu_group string vbios_path string - loaded bool focused status offsetx []int offsety []int