Fix commit listing, adding new commits to list instead of replacing

This commit is contained in:
Sebastian Martinez
2024-07-23 15:43:15 +02:00
committed by Rūdolfs Ošiņš
parent cbb6c557be
commit 7a5d4566d3
7 changed files with 37 additions and 9 deletions
+3 -3
View File
@@ -9,7 +9,7 @@
} from "@http-client";
import type { ProjectRoute } from "./router";
import { COMMITS_PER_PAGE } from "./router";
import config from "virtual:config";
import { HttpdClient } from "@http-client";
import { baseUrlToString } from "@app/lib/utils";
import { groupCommits } from "@app/lib/commit";
@@ -58,9 +58,9 @@
const response = await api.project.getAllCommits(project.id, {
parent: allCommitHeaders[0].id,
page,
perPage: COMMITS_PER_PAGE,
perPage: config.source.commitsPerPage,
});
allCommitHeaders = response;
allCommitHeaders = [...allCommitHeaders, ...response];
} catch (e) {
error = e;
}
+1 -2
View File
@@ -29,7 +29,6 @@ import { handleError, unreachableError } from "@app/views/projects/error";
import { HttpdClient } from "@http-client";
import { ResponseError, ResponseParseError } from "@http-client/lib/fetcher";
export const COMMITS_PER_PAGE = 30;
export const PATCHES_PER_PAGE = 10;
export const ISSUES_PER_PAGE = 10;
@@ -524,7 +523,7 @@ async function loadHistoryView(
await api.project.getAllCommits(project.id, {
parent: commitId,
page: 0,
perPage: COMMITS_PER_PAGE,
perPage: config.source.commitsPerPage,
}),
]);