Skip to content

Commit

Permalink
Update Notification when task is updated, fixes #115
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfs committed Jun 8, 2019
1 parent e870f6f commit ed6568c
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ else if (!diff.right().isPresent())
{
if (diff.left().value().taskVersion() != diff.right().value().taskVersion())
{
/*
* The task has been modified. If it's pinned we update it.
* Otherwise we remove it if it was pinned before.
*/
if (diff.right().value().ongoing())
if (diff.left().value().ongoing() && !diff.right().value().ongoing())
{
ActionService.startAction(this, ActionService.ACTION_RENOTIFY, diff.left().value().task());
// task has been unpinned, remove the notification
removeTaskNotification(diff.left().value().task());
}
else if (diff.left().value().ongoing())
else
{
// task has been unpinned
removeTaskNotification(diff.left().value().task());
// task was updated, also update the notification
// TODO: if the original reason for the notification is no longer true, remove the notification.
// example: the due date of a task with a due notification is moved to the future
// see https://github.com/dmfs/opentasks/issues/400
ActionService.startAction(this, ActionService.ACTION_RENOTIFY, diff.left().value().task());
}
}
}
Expand Down

0 comments on commit ed6568c

Please sign in to comment.