File tree Expand file tree Collapse file tree
MarvinsAIRARefactored/DataContext Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -880,9 +880,15 @@ public void ResetBuiltInFFBGraph( string name )
880880 }
881881 }
882882
883- // Prefer a built-in when repairing a dangling selection (there is always at least one built-in shipped).
883+ // Repairing a dangling selection (fresh installs, purged graphs): the flagship built-in graph is the
884+ // default, then any built-in (alphabetically), then anything at all.
884885 private static string FallbackGraphName ( SerializableDictionary < string , FFBGraph > graphs )
885886 {
887+ if ( graphs . TryGetValue ( FFBBuiltInGraphs . FlagshipGraphName , out var flagshipGraph ) && flagshipGraph . IsBuiltIn )
888+ {
889+ return FFBBuiltInGraphs . FlagshipGraphName ;
890+ }
891+
886892 var builtInName = graphs . Where ( pair => pair . Value . IsBuiltIn ) . Select ( pair => pair . Key ) . OrderBy ( graphName => graphName , StringComparer . OrdinalIgnoreCase ) . FirstOrDefault ( ) ;
887893
888894 return builtInName ?? graphs . Keys . FirstOrDefault ( ) ?? string . Empty ;
You can’t perform that action at this time.
0 commit comments