Skip to content

Commit 5b2116e

Browse files
committed
[BUGFIX] Load more feature
1 parent cb09ef7 commit 5b2116e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

js/fetchFurther.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// The idea is to fetch the last 20 commits in the history
77
// of each of the last 10 commits that are displayed.
8-
async function fetchFurther(commits, allCommits, heads, pageNo, branchNames) {
8+
async function fetchFurther(commits, allCommits, heads, pageNo, branchNames, allBranches) {
99
// commits array just contains the last 10 commits so that their
1010
// 10 levels of history can be fetched.
1111

@@ -119,6 +119,6 @@ async function fetchFurther(commits, allCommits, heads, pageNo, branchNames) {
119119
});
120120
pageNo += 1;
121121
var commitsToShow = (allCommits.slice(0, 10 * pageNo));
122-
await showCommits(commitsToShow, branchNames, allCommits, heads, pageNo);
122+
await showCommits(commitsToShow, branchNames, allCommits, heads, pageNo, allBranches);
123123
showLegend(heads);
124124
}

js/showCommits.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ async function showCommits(commits, branchNames, allCommits, heads, pageNo, allB
210210
setBranchOptions(branchNames, Object.keys(branchNames), allBranches);
211211
contentView.appendChild(commitsOutsideContainer);
212212

213-
addNextPageButton(commits, branchNames, allCommits, heads, pageNo);
213+
addNextPageButton(commits, branchNames, allCommits, heads, pageNo, allBranches);
214214

215215
drawGraph(commits, commitDict);
216216

@@ -248,14 +248,13 @@ function relativeTime(date) {
248248
return (output);
249249
}
250250

251-
function addNextPageButton(commits, branchNames, allCommits, heads, pageNo) {
251+
function addNextPageButton(commits, branchNames, allCommits, heads, pageNo, allBranches) {
252252
var newerButton = document.getElementById("newerButton");
253253
var olderButton = document.getElementById("olderButton");
254254
if (commits.length >= 10) {
255255
olderButton.setAttribute("aria-disabled", "false");
256256
olderButton.addEventListener("click", function () {
257-
// fetchFurther(commits, branchNames, allCommits, branches, heads, pageNo);
258-
fetchFurther(commits.slice(-10), allCommits, heads, pageNo, branchNames);
257+
fetchFurther(commits.slice(-10), allCommits, heads, pageNo, branchNames, allBranches);
259258
});
260259
}
261260
}

0 commit comments

Comments
 (0)