Skip to content

Commit

Permalink
feat: fix no comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Jan 7, 2025
1 parent 1ae553d commit 238a12b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
19 changes: 12 additions & 7 deletions src/home/rendering/render-github-notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,19 @@ async function updateLatestCommentUrls(notificationsToUpdate: { element: HTMLEle
const issueElement = element.querySelector(".issue-element-inner");
const previewElement = issueElement?.querySelector(".latest-comment-preview");

if (previewElement) {
previewElement.innerHTML = `
<div class="comment-preview">
<img src="${avatarUrl ? avatarUrl : ""}" class="comment-avatar"/>
<span class="comment-body">${commentBody ? commentBody : "No comment available."}</span>
</div>
`;
if(previewElement){
const commentPreviewDiv = document.createElement("div");
commentPreviewDiv.classList.add("comment-preview");
if (commentBody) {
commentPreviewDiv.innerHTML = `
<img src="${avatarUrl ? avatarUrl: ""}" class="comment-avatar"/>
<span class="comment-body">${commentBody}</span>
`;
commentPreviewDiv.style.padding = "8px 0px";
}
previewElement.append(commentPreviewDiv);
}

if (issueElement) {
issueElement.addEventListener("click", async() => {
window.open(url, "_blank");
Expand Down
3 changes: 0 additions & 3 deletions static/style/inverted-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,6 @@
padding: 6px 0px 8px 0px;
gap: 4px;
}
.latest-comment-preview {
padding: 8px 0px;
}

.comment-preview {
display: flex;
Expand Down
3 changes: 0 additions & 3 deletions static/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,6 @@
padding: 6px 0px 8px 0px;
gap: 4px;
}
.latest-comment-preview {
padding: 8px 0px;
}

.comment-preview {
display: flex;
Expand Down

0 comments on commit 238a12b

Please sign in to comment.