diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/presenter/HomeV2Presenter.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/presenter/HomeV2Presenter.java index 890839f2..63b656b7 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/presenter/HomeV2Presenter.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/homeV2/presenter/HomeV2Presenter.java @@ -25,6 +25,7 @@ public class HomeV2Presenter extends BasePresenter implements HomeV2PresenterInt private final HomeV2ContractInterface view; private final HomeV2GatewayInterface gateway; private final CompositeDisposable compositeDisposable; + private UserState userState=null; public HomeV2Presenter(HomeV2PresenterInterface.HomeV2ContractInterface view) { this.view = view; @@ -72,12 +73,19 @@ public class HomeV2Presenter extends BasePresenter implements HomeV2PresenterInt @Override public String checkIfUserVerified() { String resultMessage=null; - - if(!gateway.hasUserSubmittedKYC()) - resultMessage="Kindly complete your kyc registration process with us to start using GME services"; - else if(!gateway.isUserKYCVerified()) - resultMessage="Your registration request is in approval process. You will soon be able to use GME services"; - + if(userState==null) { + if (!gateway.hasUserSubmittedKYC()) + resultMessage = "Kindly complete your kyc registration process with us to start using GME services"; + else if (!gateway.isUserKYCVerified()) + resultMessage = "Your registration request is in approval process. You will soon be able to use GME services"; + } + else + { + if (!userState.hasSubmittedKyc()) + resultMessage = "Kindly complete your kyc registration process with us to start using GME services"; + else if (!userState.isVerifiedUser()) + resultMessage = "Your registration request is in approval process. You will soon be able to use GME services"; + } return resultMessage; } @@ -103,7 +111,6 @@ public class HomeV2Presenter extends BasePresenter implements HomeV2PresenterInt super.onViewDestroyed(); if (compositeDisposable != null && !compositeDisposable.isDisposed()) compositeDisposable.clear(); - } @@ -124,8 +131,8 @@ public class HomeV2Presenter extends BasePresenter implements HomeV2PresenterInt String message=""; String title=""; -// userInfoModelV2.setKyc(false); -// userInfoModelV2.setVerified(false); + userState=new UserState(userInfoModelV2.getKyc(),userInfoModelV2.getVerified()); + boolean disableKYCViewClick=userInfoModelV2.getKyc()&&!userInfoModelV2.getVerified(); boolean shouldShowKYCView=false; @@ -165,6 +172,28 @@ public class HomeV2Presenter extends BasePresenter implements HomeV2PresenterInt } } + private class UserState + { + + private boolean hasSubmittedKyc; + private boolean isVerifiedUser; + + public UserState(boolean hasSubmittedKyc, boolean isVerifiedUser) { + this.hasSubmittedKyc = hasSubmittedKyc; + this.isVerifiedUser = isVerifiedUser; + } + + boolean hasSubmittedKyc() { + return hasSubmittedKyc; + } + + boolean isVerifiedUser() { + return isVerifiedUser; + } + + + } +