mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-01 01:30:46 +08:00
Temporary fix for new remotes api
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import { formatSeedId } from "@app/utils";
|
||||
|
||||
export let peer: string | null = null;
|
||||
export let peers: string[];
|
||||
export let peers: (string | { id: string })[];
|
||||
export let toggleDropdown: (input: string) => void;
|
||||
export let peersDropdown = false;
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<Dropdown
|
||||
items={peers}
|
||||
items={peers.map((p) => typeof(p) == "string" ? p : p.id)}
|
||||
visible={peersDropdown}
|
||||
on:select={(e) => switchPeer(e.detail)}
|
||||
/>
|
||||
|
||||
+4
-4
@@ -203,12 +203,12 @@ export class Project implements ProjectInfo {
|
||||
maintainers: Urn[];
|
||||
delegates: PeerId[];
|
||||
seed: Seed;
|
||||
peers: string[];
|
||||
peers: (string | { id: string })[];
|
||||
branches: Branches;
|
||||
profile: Profile | null;
|
||||
anchors: string[];
|
||||
|
||||
constructor(urn: string, info: ProjectInfo, seed: Seed, peers: string[], branches: Branches, profile: Profile | null, anchors: string[]) {
|
||||
constructor(urn: string, info: ProjectInfo, seed: Seed, peers: (string | { id: string })[], branches: Branches, profile: Profile | null, anchors: string[]) {
|
||||
this.urn = urn;
|
||||
this.head = info.head;
|
||||
this.name = info.name;
|
||||
@@ -258,7 +258,7 @@ export class Project implements ProjectInfo {
|
||||
return api.get(`projects/${urn}/remotes/${peer}`, {}, host);
|
||||
}
|
||||
|
||||
static async getRemotes(urn: string, host: api.Host): Promise<PeerId[]> {
|
||||
static async getRemotes(urn: string, host: api.Host): Promise<(PeerId | { id: string })[]> {
|
||||
return api.get(`projects/${urn}/remotes`, {}, host);
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ export class Project implements ProjectInfo {
|
||||
// Older versions of http-api don't include the URN.
|
||||
if (! info.urn) info.urn = urn;
|
||||
|
||||
const peers: PeerId[] = info.delegates
|
||||
const peers: (PeerId | { id: string })[] = info.delegates
|
||||
? await Project.getRemotes(urn, seed.api)
|
||||
: [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user