Skip to content

Commit

Permalink
Fix: Not show the "End engagement" dialog if the engagement ends by a…
Browse files Browse the repository at this point in the history
… Visitor

MOB-1284

MUIC-768
  • Loading branch information
AndriiHorishniiMOC authored and dukhovnyi committed May 13, 2022
1 parent f798429 commit f8ad1af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public void error(GliaException exception) {

private final String TAG = "CallController";
private volatile CallState callState;
private boolean isVisitorEndEngagement = false;

private final CompositeDisposable disposables = new CompositeDisposable();

Expand Down Expand Up @@ -324,6 +325,7 @@ public void setViewCallback(CallViewCallback callViewCallback) {

public void endEngagementDialogYesClicked() {
Logger.d(TAG, "endEngagementDialogYesClicked");
isVisitorEndEngagement = true;
stop();
dialogController.dismissDialogs();
}
Expand Down Expand Up @@ -464,8 +466,10 @@ public void onSurveyLoaded(@Nullable Survey survey) {
if (viewCallback != null && survey != null) {
viewCallback.navigateToSurvey(survey);
Dependencies.getControllerFactory().destroyControllers();
} else {
} else if (!isVisitorEndEngagement) {
dialogController.showEngagementEndedDialog();
} else {
Dependencies.getControllerFactory().destroyControllers();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public void error(GliaException ex) {
private final SiteInfoUseCase siteInfoUseCase;
private final GliaSurveyUseCase surveyUseCase;

private boolean isVisitorEndEngagement = false;
private Disposable disposable = null;

// TODO pending photoCaptureFileUri - need to move some place better
Expand Down Expand Up @@ -545,6 +546,7 @@ public void unexpectedErrorDialogDismissed() {

public void endEngagementDialogYesClicked() {
Logger.d(TAG, "endEngagementDialogYesClicked");
isVisitorEndEngagement = true;
stop();
dialogController.dismissDialogs();
}
Expand Down Expand Up @@ -1176,8 +1178,10 @@ public void onSurveyLoaded(@Nullable Survey survey) {
if (viewCallback != null && survey != null) {
viewCallback.navigateToSurvey(survey);
Dependencies.getControllerFactory().destroyControllers();
} else {
} else if (!isVisitorEndEngagement) {
dialogController.showEngagementEndedDialog();
} else {
Dependencies.getControllerFactory().destroyControllers();
}
}

Expand Down

0 comments on commit f8ad1af

Please sign in to comment.