mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 22:30:41 +08:00
Only have projects on home page
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
@@ -432,4 +432,20 @@ export class Project implements ProjectInfo {
|
||||
|
||||
return new Project(urn, info, seed, peers, remote.heads, profile, anchors);
|
||||
}
|
||||
|
||||
static async getMulti(projs: { urn: Urn; seed: string }[]): Promise<{ info: ProjectInfo; seed: Host }[]> {
|
||||
const promises = [];
|
||||
|
||||
for (const proj of projs) {
|
||||
const seed = { host: proj.seed, port: null };
|
||||
promises.push(Project.getInfo(proj.urn, seed).then(info => {
|
||||
return { info, seed };
|
||||
}));
|
||||
}
|
||||
const results = await Promise.allSettled(promises);
|
||||
const isFulfilled = <T>(input: PromiseSettledResult<T>):
|
||||
input is PromiseFulfilledResult<T> => input.status === 'fulfilled';
|
||||
|
||||
return results.filter(isFulfilled).map(r => r.value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user