- Ensures that the program remains widget-type aware for enter key. Previously, if a user pressed enter while viewing the wrong type of widget, the program would panic.
@@ -95,8 +95,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
return m, nil
case "enter":
- m.Path = m.widget.(IssueCollection).Collection[m.widget.(IssueCollection).selection].Path
- return m, m.load
+ if _, ok := m.widget.(IssueCollection); ok {
+ m.Path = m.widget.(IssueCollection).Collection[m.widget.(IssueCollection).selection].Path
+ return m, m.load
+ }
+ return m, nil
case widget:
switch T := msg.(type) {