Skip to content

Commit

Permalink
Hide alarms for current task too.
Browse files Browse the repository at this point in the history
Hiding alarms for the currently edited tasks and events is still broken,
because both call listTopTags after the initial getTask/Event calls. This
immediately re-adds the alarm notifications. But at least it's broken
consistently now.
  • Loading branch information
yunosh committed Apr 14, 2014
1 parent 83e83bc commit f9ac8ca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions kronolith/js/kronolith.js
Expand Up @@ -2795,6 +2795,25 @@ KronolithCore = {
this.setTitle(task.n);
this.redBoxLoading = true;
RedBox.showHtml($('kronolithTaskDialog').show());

/* Hide alarm message for this task. */
if (r.msgs) {
r.msgs = r.msgs.reject(function(msg) {
if (msg.type != 'horde.alarm') {
return false;
}
var alarm = msg.flags.alarm;
if (alarm.params && alarm.params.notify &&
alarm.params.notify.show &&
alarm.params.notify.show.tasklist &&
alarm.params.notify.show.task &&
alarm.params.notify.show.tasklist == task.l &&
alarm.params.notify.show.task == task.id) {
return true;
}
return false;
});
}
},

/**
Expand Down

0 comments on commit f9ac8ca

Please sign in to comment.