diff --git a/src/Converters/LauncherPageConverters.cs b/src/Converters/LauncherPageConverters.cs index cc040653..8a322ad6 100644 --- a/src/Converters/LauncherPageConverters.cs +++ b/src/Converters/LauncherPageConverters.cs @@ -23,9 +23,21 @@ namespace SourceGit.Converters return false; var selected = array[1] as ViewModels.LauncherPage; - var collections = array[2] as AvaloniaList; + if (selected == null) + return true; - return selected != null && collections != null && (self == selected || collections.IndexOf(self) + 1 == collections.IndexOf(selected)); + var collections = array[2] as AvaloniaList; + if (collections == null) + return true; + + if (self == selected) + return false; + + var selfIdx = collections.IndexOf(self); + if (selfIdx == collections.Count - 1) + return true; + + return collections[selfIdx + 1] != selected; }); } }