show disconnects

This commit is contained in:
Zlatin Balevsky
2019-11-12 11:34:23 +00:00
parent eec007e83b
commit b1b2bcaef8
2 changed files with 6 additions and 3 deletions

View File

@@ -164,7 +164,10 @@ class ChatRoomController {
void handleLeave(Persona p) {
String toDisplay = DataHelper.formatTime(System.currentTimeMillis()) + " " + p.getHumanReadableName() + " disconnected\n"
runInsideUIAsync {
view.roomTextArea.append(toDisplay)
if (model.members.remove(p)) {
view.roomTextArea.append(toDisplay)
view.membersTable?.model?.fireTableDataChanged()
}
}
}
}

View File

@@ -99,8 +99,8 @@ class ChatServerModel {
}
private void handleLeave(Persona p) {
mvcGroup.childrenGroups.each {
it.controller.handleLeave(p)
mvcGroup.childrenGroups.each { k, v ->
v.controller.handleLeave(p)
}
}
}