Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanni8 committed Oct 27, 2023
1 parent 08d8d9d commit 336163d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions src/main/java/dev/ynnk/component/ChatComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
public class ChatComponent extends VerticalLayout {


private final MessageService messageService;
private final UserService userService;


Expand All @@ -27,13 +26,11 @@ public class ChatComponent extends VerticalLayout {


public ChatComponent(
final MessageService messageService,
final MessageCallback callback,
final UserService userService,
final String chatName) {

this.userService = userService;
this.messageService = messageService;

Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
User user = this.userService.findById(authentication.getName());
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/dev/ynnk/views/ChatView.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ private void initStartChatArea(){
private void changeChat(String username){
User user = this.userService.findById(username);
Chat chat = this.chatService.findByUsernames(this.currentUser.getUsername(), user.getUsername());
ChatComponent chatComponent = new ChatComponent(
this.messageService, this.messageCallback, this.userService, chat.getId().toString());
ChatComponent chatComponent = new ChatComponent(this.messageCallback, this.userService, chat.getId().toString());

this.chatWrapper.removeAll();
this.chatWrapper.add(chatComponent);
Expand Down

0 comments on commit 336163d

Please sign in to comment.