fix(frontend): inconsistent most recent repository list after page refresh (#11283)

This commit is contained in:
Hiep Le 2025-10-09 16:04:18 +07:00 committed by GitHub
parent f54a930081
commit 36b174bfb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -117,9 +117,8 @@ export function GitRepoDropdown({
const prioritizeRecentRepositories = useCallback(
(repoList: GitRepository[]) => {
const recentRepoIds = new Set(recentRepositories.map((repo) => repo.id));
const recentRepos = repoList.filter((repo) => recentRepoIds.has(repo.id));
const otherRepos = repoList.filter((repo) => !recentRepoIds.has(repo.id));
return [...recentRepos, ...otherRepos];
return [...recentRepositories, ...otherRepos];
},
[recentRepositories],
);