mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 18:20:30 +08:00
Use the dedicated commit-count endpoint
So the header and history stop fetching full tree stats just for the commit count. Falls back to the previous behaviour when the backend doesn't serve the new endpoint.
This commit is contained in:
@@ -47,8 +47,8 @@
|
||||
let totalCommits: number | undefined = undefined;
|
||||
|
||||
function fetchTotalCommits(rid: string, sha: string) {
|
||||
void api.repo.getTreeStatsBySha(rid, sha).then(stats => {
|
||||
totalCommits = stats.commits;
|
||||
void api.repo.getCommitCountBySha(rid, sha).then(commits => {
|
||||
totalCommits = commits;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
if (cached !== undefined) {
|
||||
commitCount = cached;
|
||||
} else {
|
||||
void api.repo.getTreeStatsBySha(rid, sha).then(stats => {
|
||||
commitCountCache[sha] = stats.commits;
|
||||
commitCount = stats.commits;
|
||||
void api.repo.getCommitCountBySha(rid, sha).then(commits => {
|
||||
commitCountCache[sha] = commits;
|
||||
commitCount = commits;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user