Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chtrembl committed Jan 3, 2024
1 parent 98fb929 commit ce0770f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,20 @@ protected CompletableFuture<Void> onMessageActivity(TurnContext turnContext) {
break;
}

// only respond to the user if the user sent something (seems to be a bug where
// initial messages are sent without a prompt while page loads)
if (dpResponse.getDpResponseText() != null && dpResponse.getDpResponseText().length() > 0) {
return turnContext.sendActivity(
MessageFactory.text(dpResponse.getDpResponseText())).thenApply(sendResult -> null);
if((dpResponse.getDpResponseText() == null))
{
String responseText = "I am not sure how to handle that.";

if((azurePetStoreSessionInfo == null))
{
responseText += " It may be because I did not have your session information.";
}
dpResponse.setDpResponseText(responseText);
}
return null;
}

return turnContext.sendActivity(
MessageFactory.text(dpResponse.getDpResponseText())).thenApply(sendResult -> null);
}

@Override
protected CompletableFuture<Void> onMembersAdded(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public class DPResponse {
private Classification classification = null;
private String dpResponseText = "I am not sure how to handle that.";
private String dpResponseText = null;
private List<Product> products = null;
private boolean updateCart = false;
private boolean completeCart = false;
Expand Down

0 comments on commit ce0770f

Please sign in to comment.