From 7be6ec73812f86bf09ff03e2b076ec6acd15eba4 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 Apr 2018 11:27:54 +0300 Subject: www: fix unread template --- juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'juick-www/src/main/java/com') diff --git a/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java b/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java index e840b767..ecd60a52 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java +++ b/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java @@ -67,6 +67,7 @@ public class MessagesWWW { private CrosspostService crosspostService; void fillUserModel(ModelMap model, com.juick.User user, com.juick.User visitor) { + user.setUnreadCount(messagesService.getUnread(visitor).size()); model.addAttribute("user", user); model.addAttribute("isSubscribed", userService.isSubscribed(visitor.getUid(), user.getUid())); model.addAttribute("isInBL", userService.isInBL(visitor.getUid(), user.getUid())); @@ -79,7 +80,6 @@ public class MessagesWWW { model.addAttribute("iread", userService.getUserReadLeastPopular(user.getUid(), 8)); model.addAttribute("tagStats", tagService.getUserTagStats(user.getUid()) .stream().sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())).limit(20).map(t -> t.getTag().getName()).collect(Collectors.toList())); - model.addAttribute("unread", messagesService.getUnread(visitor)); } @GetMapping("/") -- cgit v1.2.3