mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Fix more reactivity issues
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
const switchBranch = (name: string) => {
|
||||
dispatch("branchChanged", name);
|
||||
};
|
||||
|
||||
let branchLabel: string | null = null;
|
||||
|
||||
$: branchList = Object.keys(branches).sort();
|
||||
@@ -22,8 +23,10 @@
|
||||
$: commit = getOid(revision, branches) || head;
|
||||
$: if (commit == head) {
|
||||
branchLabel = project.defaultBranch;
|
||||
} else if (! isOid(revision)) {
|
||||
} else if (branches[revision]) {
|
||||
branchLabel = revision;
|
||||
} else {
|
||||
branchLabel = null;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
$: if (Object.keys(browser.branches).length > 0) {
|
||||
branches = browser.branches;
|
||||
} else {
|
||||
proj.browse({ branches });
|
||||
}
|
||||
|
||||
let dropdownState: { [key: string]: boolean } = { clone: false, seed: false, branch: false, peer: false };
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
let { urn, seed } = source;
|
||||
|
||||
const navigateHistory = (revision: string, content?: ProjectContent) => {
|
||||
proj.navigateTo({ content, revision }, source);
|
||||
proj.navigateTo({ content, revision, path: null }, source);
|
||||
};
|
||||
const fetchCommits = async (parentCommit: string): Promise<GroupedCommitsHistory> => {
|
||||
const commitsQuery = await getCommits(urn, parentCommit, seed.api);
|
||||
|
||||
@@ -43,6 +43,11 @@
|
||||
{ prop: "og:description", content: project.description },
|
||||
{ prop: "og:url", content: window.location.href }
|
||||
]);
|
||||
|
||||
// Necessary for the initial load, but causes double rendering.
|
||||
// Once the content routing is above this component, this can go
|
||||
// away.
|
||||
$: revision = $browserStore.revision;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -114,8 +119,7 @@
|
||||
<div class="description">{source.project.description}</div>
|
||||
</header>
|
||||
|
||||
<!-- TODO: Should reivision be null? -->
|
||||
{#await proj.getRoot(source.project, null, peer, source.seed.api) then { tree, branches, commit }}
|
||||
{#await proj.getRoot(source.project, revision, peer, source.seed.api) then { tree, branches, commit }}
|
||||
<Header {tree} {branches} {commit} {browserStore} {source} {peerSelector} />
|
||||
<ProjectContentRoutes {tree} {peer} {branches} {browserStore} {source} />
|
||||
{:catch err}
|
||||
|
||||
Reference in New Issue
Block a user