Skip to content

Commit

Permalink
FIX: don't add items multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
me1es committed Apr 9, 2024
1 parent 8ee2bce commit 305e4a0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/renderer/components/issues/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,19 @@ function updateIssue(err, row, elem) {
body: elem.key + " " + elem.fields.summary
})
}
if (document.getElementById(elem.key) != null && (row?.last_updated < updated && viewed < updated && updatedOnlyByMe == false)) {
document.getElementById(elem.key).classList.add("unread")
} else {

console.log(elem?.fields?.assignee?.emailAddress)
// if already in DOM list
if (document.getElementById(elem.key) != null) {

// if it has been updated set it to unread
if(row?.last_updated < updated && viewed < updated && updatedOnlyByMe == false) {
document.getElementById(elem.key).classList.add("unread")
}
// if it hasn't been updated, do nothing

// if it's not already in DOM list, add it
} else {
console.log(elem?.fields?.assignee?.emailAddress)
insertNewItem(elem.key, elem.fields.summary, elem?.fields?.assignee?.emailAddress)
}

Expand Down

0 comments on commit 305e4a0

Please sign in to comment.