diff --git a/src/App.svelte b/src/App.svelte index 21231e80d..12b509725 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,6 +1,7 @@ - - -
- - {#if selfScroll} -
- {@render children()} -
- {:else} - { - if (!loadingContent) { - loadingContent = true; - void loadMoreContent().finally(() => (loadingContent = false)); - } +{#if selfScroll} +
+ {@render children()} +
+{:else} + { + if (!loadingContent) { + loadingContent = true; + void loadMoreContent().finally(() => (loadingContent = false)); } - : undefined}> - {@render children()} - - {/if} -
+ } + : undefined}> + {@render children()} + +{/if} diff --git a/src/views/repo/Patch.svelte b/src/views/repo/Patch.svelte index c88ef0654..aa7fea604 100644 --- a/src/views/repo/Patch.svelte +++ b/src/views/repo/Patch.svelte @@ -13,7 +13,6 @@ import { nodeRunning } from "@app/lib/events"; import { invoke } from "@app/lib/invoke"; import * as router from "@app/lib/router"; - import type { SidebarData } from "@app/lib/router/definitions"; import { didFromPublicKey, explorerUrl, @@ -46,7 +45,6 @@ activity: Operation[]; status: PatchStatus | undefined; review: Review | DraftReview | undefined; - sidebarData: SidebarData; } /* eslint-disable prefer-const */ @@ -58,7 +56,6 @@ status: initialStatus, activity, review, - sidebarData, }: Props = $props(); /* eslint-enable prefer-const */ @@ -249,7 +246,7 @@ } - + {#if review} ; status: PatchStatus | undefined; - sidebarData: SidebarData; } - const { repo, patches, status, sidebarData }: Props = $props(); + const { repo, patches, status }: Props = $props(); let items = $state(patches.content); let cursor = patches.cursor; @@ -225,7 +223,7 @@ } - +
Patches diff --git a/src/views/repo/RepoHome.svelte b/src/views/repo/RepoHome.svelte index 07d2623fe..1db26c862 100644 --- a/src/views/repo/RepoHome.svelte +++ b/src/views/repo/RepoHome.svelte @@ -9,7 +9,6 @@ import { useOverlayScrollbars } from "overlayscrollbars-svelte"; import { invoke, InvokeError } from "@app/lib/invoke"; - import type { SidebarData } from "@app/lib/router/definitions"; import { highlight } from "@app/lib/syntax"; import FileBlock from "@app/components/FileBlock.svelte"; @@ -27,11 +26,10 @@ tree: Tree; repo: RepoInfo; readme: Readme | null; - sidebarData: SidebarData; } /* eslint-disable prefer-const */ - let { tree, readme, repo, sidebarData }: Props = $props(); + let { tree, readme, repo }: Props = $props(); /* eslint-enable prefer-const */ let currentPath = $state(""); @@ -120,7 +118,7 @@ } - +
; status: PatchStatus | undefined; sidebarData: SidebarData; @@ -137,10 +134,9 @@ export type LoadedRepoRoute = export async function loadPatch( route: RepoPatchRoute, ): Promise { - const [sidebarData, config, repo, patches, patch, revisions, activity] = + const [sidebarData, repo, patches, patch, revisions, activity] = await Promise.all([ loadSidebarData(), - invoke("config"), invoke("repo_by_id", { rid: route.rid, }), @@ -163,6 +159,8 @@ export async function loadPatch( }), ]); + const config = sidebarData.config; + const draftReview = route.reviewId !== undefined && draftReviewStorage.get(route.reviewId, { @@ -195,9 +193,8 @@ export async function loadPatch( export async function loadPatches( route: RepoPatchesRoute, ): Promise { - const [sidebarData, config, repo, patches] = await Promise.all([ + const [sidebarData, repo, patches] = await Promise.all([ loadSidebarData(), - invoke("config"), invoke("repo_by_id", { rid: route.rid, }), @@ -210,16 +207,15 @@ export async function loadPatches( return { resource: "repo.patches", - params: { sidebarData, repo, config, patches, status: route.status }, + params: { sidebarData, repo, patches, status: route.status }, }; } export async function loadRepoHome( route: RepoHomeRoute, ): Promise { - const [sidebarData, config, repo, readme, tree] = await Promise.all([ + const [sidebarData, repo, readme, tree] = await Promise.all([ loadSidebarData(), - invoke("config"), invoke("repo_by_id", { rid: route.rid, }), @@ -235,17 +231,16 @@ export async function loadRepoHome( return { resource: "repo.home", - params: { sidebarData, repo, sha: route.sha, config, readme, tree }, + params: { sidebarData, repo, sha: route.sha, readme, tree }, }; } export async function loadIssue( route: RepoIssueRoute, ): Promise { - const [sidebarData, config, repo, issue, activity, issues, threads] = + const [sidebarData, repo, issue, activity, issues, threads] = await Promise.all([ loadSidebarData(), - invoke("config"), invoke("repo_by_id", { rid: route.rid, }), @@ -272,7 +267,7 @@ export async function loadIssue( params: { sidebarData, repo, - config, + config: sidebarData.config, issue, activity, issues, @@ -285,9 +280,8 @@ export async function loadIssue( export async function loadIssues( route: RepoIssuesRoute, ): Promise { - const [sidebarData, config, repo, issues] = await Promise.all([ + const [sidebarData, repo, issues] = await Promise.all([ loadSidebarData(), - invoke("config"), invoke("repo_by_id", { rid: route.rid, }), @@ -299,7 +293,7 @@ export async function loadIssues( return { resource: "repo.issues", - params: { sidebarData, repo, config, issues, status: route.status }, + params: { sidebarData, repo, issues, status: route.status }, }; }