mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-03 18:50:30 +08:00
Fix issue fetching when not supported
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
@@ -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)
|
||||
|
||||
+2
-5
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user