Skip to content

Commit

Permalink
feat: proper redirect URL
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Dec 8, 2024
1 parent 98f1463 commit 898a618
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/home/rendering/render-github-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ function everyNewNotification({ notification, notificationsContainer }: { notifi

const labels = parseAndGenerateLabels(notification);
const [organizationName, repositoryName] = notification.notification.repository.url.split("/").slice(-2);
setUpIssueElement(issueElement, notification, organizationName, repositoryName, labels, notification.notification.subject.url);
let url;
if(notification.notification.subject.type === "Issue"){
url = notification.issue.html_url;
} else if(notification.notification.subject.type === "PullRequest"){
url = notification.pullRequest?.html_url;
}
setUpIssueElement(issueElement, notification, organizationName, repositoryName, labels, url as string);
issueWrapper.appendChild(issueElement);

notificationsContainer.appendChild(issueWrapper);
Expand Down Expand Up @@ -100,12 +106,8 @@ function setUpIssueElement(

issueWrapper.classList.add("selected");

const full = notification;
if (!full) {
window.open(url, "_blank");
} else {
//previewIssue(notification);
}
window.open(url, "_blank");

} catch (error) {
return renderErrorInModal(error as Error);
}
Expand Down

0 comments on commit 898a618

Please sign in to comment.