Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit ae0c9ec

Browse files
committed
Merge fixes/repository-list into release/1.0.16.1
2 parents aa96cb6 + 702665b commit ae0c9ec

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/GitHub.App/Services/ModelService.cs

+4-12
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ IObservable<IEnumerable<AccountCacheItem>> GetUser()
9898
{
9999
return hostCache.GetAndRefreshObject("user",
100100
() => apiClient.GetUser().Select(AccountCacheItem.Create), TimeSpan.FromMinutes(5), TimeSpan.FromDays(7))
101-
.PublishLast()
102-
.RefCount()
101+
.TakeLast(1)
103102
.ToList();
104103
}
105104

@@ -126,12 +125,8 @@ IObservable<IEnumerable<AccountCacheItem>> GetUserOrganizations()
126125
public IObservable<IReadOnlyList<IRepositoryModel>> GetRepositories()
127126
{
128127
return GetUserRepositories(RepositoryType.Owner)
129-
.PublishLast()
130-
.RefCount()
131-
.Concat(GetUserRepositories(RepositoryType.Member)
132-
.PublishLast()
133-
.RefCount()
134-
)
128+
.TakeLast(1)
129+
.Concat(GetUserRepositories(RepositoryType.Member).TakeLast(1))
135130
.Concat(GetAllRepositoriesForAllOrganizations());
136131
}
137132

@@ -207,10 +202,7 @@ IObservable<IReadOnlyList<IRepositoryModel>> GetAllRepositoriesForAllOrganizatio
207202
{
208203
return GetUserOrganizations()
209204
.SelectMany(org => org.ToObservable())
210-
.SelectMany(org => GetOrganizationRepositories(org.Login)
211-
.PublishLast()
212-
.RefCount()
213-
);
205+
.SelectMany(org => GetOrganizationRepositories(org.Login).TakeLast(1));
214206
}
215207

216208
IObservable<IReadOnlyList<IRepositoryModel>> GetOrganizationRepositories(string organization)

0 commit comments

Comments
 (0)