mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-16 06:49:09 +02:00
fix: fix webview on root repo
This commit is contained in:
@@ -131,7 +131,7 @@ export default class AnonymizedFile {
|
||||
span.setAttribute("file", this.anonymizedPath);
|
||||
try {
|
||||
span.setAttribute("anonymizedPath", this.anonymizedPath);
|
||||
if (!this.anonymizedPath) {
|
||||
if (this.anonymizedPath == null) {
|
||||
throw new AnonymousError("path_not_specified", {
|
||||
object: this,
|
||||
httpStatus: 400,
|
||||
|
||||
@@ -205,7 +205,7 @@ export default class GitHubStream extends GitHubBase {
|
||||
});
|
||||
}
|
||||
}
|
||||
const promises: Promise<any>[] = [];
|
||||
const promises: ReturnType<GitHubStream["getGHTree"]>[] = [];
|
||||
const parentPaths: string[] = [];
|
||||
for (const file of data.tree) {
|
||||
if (file.type == "tree" && file.path && file.sha) {
|
||||
@@ -224,6 +224,9 @@ export default class GitHubStream extends GitHubBase {
|
||||
}
|
||||
}
|
||||
(await Promise.all(promises)).forEach((data, i) => {
|
||||
if (data.truncated) {
|
||||
// TODO: the tree is truncated
|
||||
}
|
||||
output.push(...this.tree2Tree(data.tree, parentPaths[i]));
|
||||
});
|
||||
return output;
|
||||
|
||||
Reference in New Issue
Block a user