diff --git a/web/src/lib/components/repo/pulls/PullCommitList.svelte b/web/src/lib/components/repo/pulls/PullCommitList.svelte index e673dada2..401de460b 100644 --- a/web/src/lib/components/repo/pulls/PullCommitList.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitList.svelte @@ -23,7 +23,8 @@ let { commits, pipelineStatuses, selection, showChangeIds = $bindable(true) }: Props = $props(); - const toggleIds = () => (showChangeIds = !showChangeIds); + const hasChangeIds = $derived(commits.some((commit) => commit.changeId !== undefined)); + const toggleIds = $derived(hasChangeIds ? () => (showChangeIds = !showChangeIds) : undefined); // where row `i` sits inside a range, so the row can style its own ends function band(i: number, { start, end }: Range): Band { diff --git a/web/src/lib/components/repo/pulls/PullCommitRow.svelte b/web/src/lib/components/repo/pulls/PullCommitRow.svelte index 6b260b36b..7176aa802 100644 --- a/web/src/lib/components/repo/pulls/PullCommitRow.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitRow.svelte @@ -72,7 +72,7 @@ {onclick} > {/if} - {#if changeId} + {#if ontoggleIds}