Skip to content

Commit

Permalink
Return immediately on changing mounts if there are less than 2
Browse files Browse the repository at this point in the history
  • Loading branch information
slarwise committed Aug 16, 2024
1 parent da5e66d commit 598f24d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ func (u *Ui) moveDown() {
}

func (u *Ui) nextMount() {
if len(u.Mounts) < 2 {
return
}
if u.CurrentMount == 0 {
u.CurrentMount = len(u.Mounts) - 1
} else {
Expand All @@ -379,6 +382,9 @@ func (u *Ui) nextMount() {
}

func (u *Ui) previousMount() {
if len(u.Mounts) < 2 {
return
}
u.CurrentMount = (u.CurrentMount + 1) % len(u.Mounts)
drawLoadingScreen(*u)
u.Screen.Show()
Expand Down

0 comments on commit 598f24d

Please sign in to comment.