@@ -69,23 +69,11 @@ public async Task InitializeAsync(ILocalRepositoryModel repository, IConnection
6969 Observable . CombineLatest (
7070 modelService . GetAccounts ( ) ,
7171 modelService . GetRepository ( repository . Owner , repository . Name ) ,
72- modelService . GetForks ( repository ) . ToList ( ) ,
73- ( a , r , f ) => new { Accounts = a , Respoitory = r , Forks = f } )
72+ ( a , r ) => new { Accounts = a , Respoitory = r } )
7473 . Finally ( ( ) => IsLoading = false )
7574 . Subscribe ( x =>
7675 {
77- var forksAndParents = new List < IRemoteRepositoryModel > ( x . Forks ) ;
78- var current = x . Respoitory ;
79- while ( current . Parent != null )
80- {
81- forksAndParents . Add ( current . Parent ) ;
82- current = current . Parent ;
83- }
84-
85- Accounts = BuildAccounts ( x . Accounts , forksAndParents , repository . Owner ) ;
86- ExistingForks = forksAndParents ;
87-
88- log . Verbose ( "Loaded Data Accounts:{Accounts} Forks:{Forks}" , Accounts . Count , ExistingForks . Count ) ;
76+ Accounts = BuildAccounts ( x . Accounts , repository . Owner ) ;
8977 } ) ;
9078
9179 }
@@ -96,12 +84,10 @@ public async Task InitializeAsync(ILocalRepositoryModel repository, IConnection
9684 }
9785 }
9886
99- IReadOnlyList < IAccount > BuildAccounts ( IEnumerable < IAccount > accessibleAccounts , IList < IRemoteRepositoryModel > forksAndParents , string currentRepositoryOwner )
87+ IReadOnlyList < IAccount > BuildAccounts ( IEnumerable < IAccount > accessibleAccounts , string currentRepositoryOwner )
10088 {
101- var forksByOwner = forksAndParents . ToDictionary ( x => x . Owner , x => x ) ;
10289 return accessibleAccounts
103- . Where ( x => x . Login != currentRepositoryOwner )
104- . Where ( x => ! forksByOwner . ContainsKey ( x . Login ) ) . ToList ( ) ;
90+ . Where ( x => x . Login != currentRepositoryOwner ) . ToList ( ) ;
10591 }
10692 }
10793}
0 commit comments