mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-12-02 19:40:35 +08:00
explorer: Fetch only the tip commit header for repo cards
Repo cards fetched their tip commit from `/commits/:sha` only to show when it was made. That endpoint diffs the commit and inlines its blobs, so every repo listing made httpd diff the tip commit of each repo on the page. Take the commit from `/commits?parent=:sha&perPage=1` instead, which returns only the commit header.
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
$: baseUrl = repoInfo.baseUrl;
|
||||
$: isPrivate = repo.visibility.type === "private";
|
||||
$: tip = defaultBranchTip(repo);
|
||||
$: tipCommit = tip
|
||||
? api.repo
|
||||
.getAllCommits(repo.rid, { parent: tip, perPage: 1 })
|
||||
.then(commits => commits[0])
|
||||
: undefined;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -229,9 +234,8 @@
|
||||
<Icon name="patch" />
|
||||
{repo.cobs.patches.open}
|
||||
{/if}
|
||||
{#await tip && api.repo.getCommitBySha(repo.rid, tip) then result}
|
||||
{#if result}
|
||||
{@const commit = result.commit}
|
||||
{#await tipCommit then commit}
|
||||
{#if commit}
|
||||
<span
|
||||
class="txt-body-m-regular"
|
||||
style:margin-left="auto"
|
||||
|
||||
Reference in New Issue
Block a user