diff --git a/src/main/java/tuteez/logic/commands/EditCommand.java b/src/main/java/tuteez/logic/commands/EditCommand.java index 03de77805e8..4533a77bcd3 100644 --- a/src/main/java/tuteez/logic/commands/EditCommand.java +++ b/src/main/java/tuteez/logic/commands/EditCommand.java @@ -113,6 +113,12 @@ public CommandResult execute(Model model) throws CommandException { } model.setPerson(personToEdit, editedPerson); + if (personToEdit.equals(model.getLastViewedPerson().get().get())) { + model.updateLastViewedPerson(editedPerson); + String logMessageForPerson = + String.format("Student on display is edited, After Edit - Student: %s", editedPerson); + logger.info(logMessageForPerson); + } model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS); String logMessage = String.format("Before Edit - Student: %s%nAfter Edit - Student: %s", personToEdit, editedPerson);