mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Remove redundant selectedCommit route property
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
|
||||
export let baseUrl: BaseUrl;
|
||||
export let branches: Record<string, string> | undefined;
|
||||
export let commit: string;
|
||||
export let commitCount: number;
|
||||
export let contributorCount: number;
|
||||
export let path: string;
|
||||
@@ -34,16 +33,18 @@
|
||||
const api = new HttpdClient(baseUrl);
|
||||
|
||||
const fetchTree = async (path: string) => {
|
||||
return api.project.getTree(project.id, commit, path).catch(() => {
|
||||
blobResult = {
|
||||
ok: false,
|
||||
error: {
|
||||
message: "Not able to expand directory",
|
||||
path,
|
||||
},
|
||||
};
|
||||
return undefined;
|
||||
});
|
||||
return api.project
|
||||
.getTree(project.id, tree.lastCommit.id, path)
|
||||
.catch(() => {
|
||||
blobResult = {
|
||||
ok: false,
|
||||
error: {
|
||||
message: "Not able to expand directory",
|
||||
path,
|
||||
},
|
||||
};
|
||||
return undefined;
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -182,7 +183,11 @@
|
||||
{path}
|
||||
blob={blobResult.blob}
|
||||
highlighted={blobResult.highlighted}
|
||||
rawPath={utils.getRawBasePath(project.id, baseUrl, commit)} />
|
||||
rawPath={utils.getRawBasePath(
|
||||
project.id,
|
||||
baseUrl,
|
||||
tree.lastCommit.id,
|
||||
)} />
|
||||
{:else}
|
||||
<Placeholder emoji="🍂">
|
||||
<span slot="title">
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
<Browser
|
||||
blobResult={view.blobResult}
|
||||
branches={view.params.loadedBranches}
|
||||
commit={view.params.selectedCommit}
|
||||
commitCount={view.params.loadedTree.stats.commits}
|
||||
contributorCount={view.params.loadedTree.stats.contributors}
|
||||
path={view.path}
|
||||
|
||||
@@ -75,7 +75,6 @@ interface LoadedSourceBrowsingParams {
|
||||
loadedBranches: Record<string, string> | undefined;
|
||||
loadedPeers: Remote[];
|
||||
loadedTree: Tree;
|
||||
selectedCommit: string;
|
||||
}
|
||||
|
||||
export type BlobResult =
|
||||
@@ -202,7 +201,6 @@ export async function loadProjectRoute(
|
||||
loadedBranches: branches,
|
||||
loadedPeers: peers,
|
||||
loadedTree: tree,
|
||||
selectedCommit: commit,
|
||||
};
|
||||
if (params.view.resource === "tree") {
|
||||
let blobResult: BlobResult;
|
||||
@@ -295,7 +293,6 @@ export async function loadProjectRoute(
|
||||
loadedBranches: undefined,
|
||||
loadedPeers: peers,
|
||||
loadedTree: tree,
|
||||
selectedCommit: params.view.commitId,
|
||||
};
|
||||
const loadedCommit = await api.project.getCommitBySha(
|
||||
params.id,
|
||||
|
||||
Reference in New Issue
Block a user