bugfix: reload only once

This commit is contained in:
Khalid Huseynov 2016-09-21 01:25:55 +09:00
parent 537cc0ebad
commit 781207e15b
2 changed files with 3 additions and 3 deletions

View file

@ -550,7 +550,7 @@ public class NotebookServer extends WebSocketServlet implements
}
public void broadcastReloadedNoteList(AuthenticationInfo subject) {
//send first to requesting user
//reload and reply first to requesting user
List<Map<String, String>> notesInfo = generateNotebooksInfo(true, subject);
multicastToUser(subject.getUser(), new Message(OP.NOTES_INFO).put("notes", notesInfo));
//to others afterwards
@ -558,7 +558,8 @@ public class NotebookServer extends WebSocketServlet implements
if (subject.getUser() == user) {
continue;
}
notesInfo = generateNotebooksInfo(true, new AuthenticationInfo(user));
//reloaded already above; parameter - false
notesInfo = generateNotebooksInfo(false, new AuthenticationInfo(user));
multicastToUser(user, new Message(OP.NOTES_INFO).put("notes", notesInfo));
}
}

View file

@ -482,7 +482,6 @@ public class Notebook implements NoteEventListener {
}
List<NoteInfo> noteInfos = notebookRepo.list(subject);
noteInfos = notebookAuthorization.filterByUser(noteInfos, subject);
for (NoteInfo info : noteInfos) {
loadNoteFromRepo(info.getId(), subject);