Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhavan7 committed Dec 2, 2022
1 parent aa10e64 commit dd97bbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 8 additions & 6 deletions src/main/java/screens/login_screen/AppScreenCreator.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package screens.login_screen;
import interface_adapters.appscreen.AppScreenLoader;
import interface_adapters.login_interface_adapters.UserChatsPresenter;
import interface_adapters.login_interface_adapters.UserLoginViewI;
import screens.appscreen.AppScreen;
import use_cases.user_login_use_cases.UserLoginOutputBoundary;

import java.util.ArrayList;

public class AppScreenCreator implements UserLoginViewI {
private String username ;
private ArrayList<String> chats;
private boolean userNotExists;
private boolean passNotMatched;
AppScreen appScreen;
AppScreenLoader appScreenLoader;
public AppScreenCreator(){
}
@Override
Expand All @@ -19,7 +19,8 @@ public void display() {
showUnableToLogin();
}else{
/*this.appScreen = new AppScreen(username, chats);*/
System.out.println(username);
//Could be null pointer exception if setChatsPresenter is not called before the below
appScreenLoader.openScreen();
}
}

Expand All @@ -28,10 +29,11 @@ private void showUnableToLogin() {
}
@Override
public void setChatsPresenter(UserLoginOutputBoundary chatsPresenter){
this.username = chatsPresenter.getUsername();
this.chats = (ArrayList<String>) chatsPresenter.getChats();
String username = chatsPresenter.getUsername();
ArrayList<String> chats = (ArrayList<String>) chatsPresenter.getChats();
this.userNotExists = chatsPresenter.isNotExists();
this.passNotMatched = chatsPresenter.isNotMatched();
appScreenLoader = new AppScreenLoader(username, chats);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ public UserLoginInteractor2(Database database, UserLoginOutputBoundary chatPrese
public void login(String username, String password) {
//will update this.chatPresenter
//TODO: change below, as its just temporary
chatPresenter.setChats(new ArrayList<>());
chatPresenter.setUsername(username);
chatPresenter.setUserNotExists(false);
chatPresenter.setPasswordNotMatched(false);
user = database.getUser(username);


}

Expand Down

0 comments on commit dd97bbc

Please sign in to comment.