Skip to content

Commit

Permalink
FIX: update logic if not already in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
me1es committed Apr 8, 2024
1 parent ea126f5 commit 343a385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/issues/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function updateIssue(err, row, elem) {
let assignee_emailAddress = elem.fields.assignee
}

if (row == undefined && updatedOnlyByMe == false || (row.last_updated < updated && viewed < updated && updatedOnlyByMe == false)) {
if (row == undefined && updatedOnlyByMe == false || (row?.last_updated < updated && viewed < updated && updatedOnlyByMe == false)) {
dbm.updateIssueInDB(elem.key, elem.fields.summary, assignee_emailAddress, updated)
window.notificationCount++
if (window.notificationCount < 5) {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/models/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ class DatabaseModel {
* @param {*} callback function to handle the response
*/
getIssueFromDB(element, callback) {
this.db.get("SELECT * FROM issues WHERE key=?", element.key, function(err, row) {
if(row != undefined) {
this.db.get("SELECT * FROM issues WHERE key='?'", element.key, function(err, row) {
// if(row != undefined) {
callback(err, row, element)
}
// }
}.bind(this));
}

Expand Down

0 comments on commit 343a385

Please sign in to comment.