Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix issue fetching when not supported
Sebastian Martinez committed 3 years ago
commit b2c2aeea3c0a942f97ea21ebce33d9778e514859
parent 17fa47d41baefa81a565cb7ba5aa876e2aab2e8c
2 files changed +12 -5
modified src/base/projects/Header.svelte
@@ -81,6 +81,12 @@
  .clickable:hover {
    background-color: var(--color-foreground-background-lighter);
  }
+
  .not-allowed {
+
    cursor: not-allowed;
+
  }
+
  .not-allowed.widget {
+
    color: var(--color-foreground-faded);
+
  }
  .clone {
    color: var(--color-yellow);
    background-color: var(--color-yellow-background);
@@ -196,6 +202,10 @@
    <div class="stat issue-count clickable widget" class:active={content == ProjectContent.Issues} on:click={toggleIssues}>
      <strong>{groupIssues(issues).open.length}</strong> issue(s)
    </div>
+
  {:catch e}
+
    <div class="stat issue-count not-allowed widget" title="Not supported">
+
      0 issue(s)
+
    </div>
  {/await}
  <div class="stat contributor-count widget">
    <strong>{tree.stats.contributors}</strong> contributor(s)
modified src/project.ts
@@ -235,11 +235,10 @@ export class Project implements ProjectInfo {
  seed: Seed;
  peers: Peer[];
  branches: Branches;
-
  issues: Issue[];
  profile: Profile | null;
  anchors: string[];

-
  constructor(urn: string, info: ProjectInfo, seed: Seed, peers: Peer[], branches: Branches, profile: Profile | null, anchors: string[], issues: Issue[]) {
+
  constructor(urn: string, info: ProjectInfo, seed: Seed, peers: Peer[], branches: Branches, profile: Profile | null, anchors: string[]) {
    this.urn = urn;
    this.head = info.head;
    this.name = info.name;
@@ -250,7 +249,6 @@ export class Project implements ProjectInfo {
    this.seed = seed;
    this.peers = peers;
    this.branches = branches;
-
    this.issues = issues;
    this.profile = profile;
    this.anchors = anchors;
  }
@@ -386,7 +384,6 @@ export class Project implements ProjectInfo {
    const info = await Project.getInfo(id, seed.api);
    const urn = isRadicleId(id) ? id : info.urn;
    const anchors = profile ? await profile.confirmedProjectAnchors(urn, config) : [];
-
    const issues = await Project.getIssues(urn, seed.api);

    // Older versions of http-api don't include the URN.
    if (! info.urn) info.urn = urn;
@@ -407,6 +404,6 @@ export class Project implements ProjectInfo {
      }
    }

-
    return new Project(urn, info, seed, peers, remote.heads, profile, anchors, issues);
+
    return new Project(urn, info, seed, peers, remote.heads, profile, anchors);
  }
}