Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix more reactivity issues
Alexis Sellier committed 4 years ago
commit 7e9e40738249470c80c4bd32642a78395ffbe463
parent 27895b7d0cab4b137bc5de15bbefc68da30b1d54
4 files changed +13 -4
modified src/base/projects/BranchSelector.svelte
@@ -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>

modified src/base/projects/Header.svelte
@@ -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 };
modified src/base/projects/History.svelte
@@ -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);
modified src/base/projects/Project.svelte
@@ -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}