fix(ui): switch to files tab on window resize

Ayman Bagabas created

Change summary

ui/pages/repo/refs.go | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

Detailed changes

ui/pages/repo/refs.go 🔗

@@ -126,12 +126,11 @@ func (r *Refs) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 	case selector.SelectMsg:
 		switch i := msg.IdentifiableItem.(type) {
 		case RefItem:
-			cmds = append(cmds, switchRefCmd(i.Reference))
+			cmds = append(cmds,
+				switchRefCmd(i.Reference),
+				tabs.SelectTabCmd(int(filesTab)),
+			)
 		}
-	// FileItemsMsg indicates that the Files model has updated the items and
-	// it's time to switch tabs.
-	case FileItemsMsg:
-		cmds = append(cmds, tabs.SelectTabCmd(int(filesTab)))
 	case tea.KeyMsg:
 		switch msg.String() {
 		case "l", "right":