Skip to content

Commit

Permalink
Fix redo interaction with reminder
Browse files Browse the repository at this point in the history
  • Loading branch information
blimyj committed Oct 31, 2019
1 parent 9dbb455 commit d05b7a9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/seedu/elisa/model/ItemModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ public void addToSeparateList(Item item) {

if (item.hasReminder()) {
reminderList.add(item);
futureReminders.add(item);
if (item.getReminder().get().getOccurrenceDateTime().isAfter(LocalDateTime.now())) {
futureReminders.add(item);
} else {
activeReminders.add(item);
}
}
}

Expand Down Expand Up @@ -264,6 +268,8 @@ public Item removeItem(Item item) {
} else {
// never reached here as there are only three variants for the visualList
}
activeReminders.remove(item);
futureReminders.remove(item);
return removedItem;
}

Expand Down Expand Up @@ -291,6 +297,8 @@ public Item deleteItem(int index) {
taskList.remove(item);
eventList.remove(item);
reminderList.remove(item);
futureReminders.remove(item);
activeReminders.remove(item);
if (priorityMode.getValue()) {
getNextTask();
}
Expand All @@ -308,6 +316,8 @@ public Item deleteItem(Item item) {
taskList.removeItemFromList(item);
eventList.removeItemFromList(item);
reminderList.removeItemFromList(item);
activeReminders.remove(item);
futureReminders.remove(item);
if (priorityMode.getValue()) {
getNextTask();
}
Expand Down

0 comments on commit d05b7a9

Please sign in to comment.