Skip to content

Commit

Permalink
Fixed the page load sequence to display the chat canvas as soon as th…
Browse files Browse the repository at this point in the history
…e connection to Direct Line is initiated.
  • Loading branch information
barneaoren committed Dec 6, 2017
1 parent f2c77bd commit 6f6a5c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions public/index.js
Expand Up @@ -67,11 +67,11 @@ function initBotConversation() {
//domain: "",
webSocket: true
});
botConnection.postActivity({type: "event", value: jsonWebToken, from: user, name: "InitAuthenticatedConversation"}).subscribe(function (id) {startChat(user, botConnection)});
startChat(user, botConnection);
botConnection.postActivity({type: "event", value: jsonWebToken, from: user, name: "InitAuthenticatedConversation"}).subscribe(function (id) {});
botConnection.activity$
.filter(function (activity) {return activity.type === "event" && activity.name === "shareLocation"})
.subscribe(function (activity) {sendUserLocation(botConnection, user)});

}

function startChat(user, botConnection) {
Expand Down
4 changes: 2 additions & 2 deletions views/index.ejs
Expand Up @@ -11,8 +11,8 @@

</head>

<body onload="chatRequested()">

<body>
<div id="botContainer" style="width:100%"></div>
<script>chatRequested();</script>
</body>
</html>

0 comments on commit 6f6a5c1

Please sign in to comment.