Remove redundant selectedCommit route property

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
This commit is contained in:
Thomas Scholtes
2023-07-11 14:22:41 +02:00
committed by Rūdolfs Ošiņš
parent 9294e23ea4
commit f09e3f6edf
3 changed files with 17 additions and 16 deletions
+17 -12
View File
@@ -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">
-1
View File
@@ -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}
-3
View File
@@ -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,