Skip to content

Commit

Permalink
ui fix on show command
Browse files Browse the repository at this point in the history
  • Loading branch information
TehZiHuai committed Nov 10, 2019
1 parent 27042c4 commit 979877e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/main/java/Operations/OverdueList.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ public void add(Task task) {
public void reschedule(int[] idx, TaskList taskList) throws RoomShareException {
int[] index = idx.clone();
if (index.length ==1) {
if (index[0] < 0 || index[0] >= Overdue.size()) {
if (index[0] < 0 || index[0] >= overdue.size()) {
System.out.println("This are your tasks in your Overdue list");
list();
throw new RoomShareException(ExceptionType.outOfBounds);
} else {
taskList.add(Overdue.get(index[0]));
Overdue.get(index[0]).setOverdue(false);
taskList.add(overdue.get(index[0]));
overdue.get(index[0]).setOverdue(false);
}
} else {
if (index[0] < 0 || index[0] >= Overdue.size() || index[1] < 0 || index[1] >= Overdue.size()) {
if (index[0] < 0 || index[0] >= overdue.size() || index[1] < 0 || index[1] >= overdue.size()) {
throw new RoomShareException(ExceptionType.outOfBounds);
}
for (int i = index[0]; i <= index[1]; i++){
taskList.add(Overdue.get(i));
Overdue.get(i).setOverdue(false);
taskList.add(overdue.get(i));
overdue.get(i).setOverdue(false);
}
}
for (int i = 0; i < index.length; i++){
Overdue.removeIf(n -> !n.getOverdue());
overdue.removeIf(n -> !n.getOverdue());
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main/java/RoomShare.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ public void run() throws RoomShareException, IOException, InterruptedException {
} catch (RoomShareException e) {
ui.showError(e);
}
listRoutine.list();
} else {
ui.showTagged(input);
int[] doneArray = taskList.listTagged(input);
Expand Down

0 comments on commit 979877e

Please sign in to comment.