Skip to content

Commit

Permalink
feat: make the rendering more flexible for inconsistent urls being po…
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Feb 24, 2024
1 parent 0b8f1e6 commit a41a4d8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/home/rendering/render-github-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ export function renderGitHubIssues(tasks: TaskMaybeFull[]) {
for (const task of tasks) {
if (!existingIssueIds.has(task.preview.id.toString())) {
const issueWrapper = everyNewIssue({ taskPreview: task, container });
setTimeout(() => issueWrapper.classList.add("active"), delay);
delay += baseDelay;
if (issueWrapper) {
setTimeout(() => issueWrapper.classList.add("active"), delay);
delay += baseDelay;
}
}
}
container.classList.add("ready");
Expand All @@ -47,12 +49,14 @@ function everyNewIssue({ taskPreview, container }: { taskPreview: TaskMaybeFull;
const organizationName = match?.[1];

if (!organizationName) {
throw new Error(`No organization name found for issue ${taskPreview.preview.id}.`);
console.warn(`No organization name found for issue ${taskPreview.preview.id}.`);
return;
}

const repositoryName = match?.[2];
if (!repositoryName) {
throw new Error("No repository name found");
console.warn("No repository name found");
return;
}
const labels = parseAndGenerateLabels(taskPreview);
setUpIssueElement(issueElement, taskPreview, organizationName, repositoryName, labels, match);
Expand Down

0 comments on commit a41a4d8

Please sign in to comment.