diff --git a/src/views/repos/Changeset.svelte b/src/views/repos/Changeset.svelte index d927eaa7e..04134214e 100644 --- a/src/views/repos/Changeset.svelte +++ b/src/views/repos/Changeset.svelte @@ -7,11 +7,11 @@ import Icon from "@app/components/Icon.svelte"; import Observer, { intersection } from "@app/components/Observer.svelte"; - export let diff: Diff; - export let files: Record; + export let diff: Diff | undefined = undefined; + export let files: Record | undefined = undefined; export let baseUrl: BaseUrl; export let repoId: string; - export let revision: string; + export let revision: string | undefined = undefined; let expanded = true; @@ -73,63 +73,67 @@ } -
-
- {diffDescription(diff.files)} - with - 0}> - {diff.stats.insertions} - {pluralize("insertion", diff.stats.insertions)} - - and - 0}> - {diff.stats.deletions} - {pluralize("deletion", diff.stats.deletions)} - -
- {#if diff.stats.filesChanged > 1} - (expanded = !expanded)}> - {#if expanded === true} - - Collapse all - {:else} - - Expand all - {/if} - - {/if} -
- -
- - {#each diff.files as file} - {@const path = "path" in file ? file.path : file.newPath} -
- {#if "diff" in file} - +{#if diff} +
+
+ {diffDescription(diff.files)} + with + 0}> + {diff.stats.insertions} + {pluralize("insertion", diff.stats.insertions)} + + and + 0}> + {diff.stats.deletions} + {pluralize("deletion", diff.stats.deletions)} + +
+ {#if diff.stats.filesChanged > 1} + (expanded = !expanded)}> + {#if expanded === true} + + Collapse all {:else} - + + Expand all {/if} -
- {/each} - -
+ + {/if} +
+ +
+ + {#each diff.files as file} + {@const path = "path" in file ? file.path : file.newPath} +
+ {#if "diff" in file} + + {:else} + + {/if} +
+ {/each} +
+
+{/if} diff --git a/src/views/repos/Commit.svelte b/src/views/repos/Commit.svelte index ebeba59fe..6a404f089 100644 --- a/src/views/repos/Commit.svelte +++ b/src/views/repos/Commit.svelte @@ -146,8 +146,8 @@ + files={commit?.files} + diff={commit?.diff} + revision={commit?.commit?.id} />