Permalink
Browse files

Fix examples.

  • Loading branch information...
1 parent 6f79a31 commit a5f0ec7c7da0398d03a7ebd2af6bedbac5e573db @fred-wang fred-wang committed Nov 12, 2016
Showing with 21 additions and 9 deletions.
  1. +1 −1 examples/browser/lib/matrix.js
  2. +9 −5 examples/node/app.js
  3. +10 −2 examples/voip/browserTest.js
  4. +1 −1 examples/voip/lib/matrix.js
View
@@ -135,11 +135,15 @@ rl.on('line', function(line) {
// ==== END User input
// show the room list after syncing.
-matrixClient.on("syncComplete", function() {
- setRoomList();
- printRoomList();
- printHelp();
- rl.prompt();
+matrixClient.on("sync", function(state, prevState, data) {
+ switch (state) {
+ case "PREPARED":
+ setRoomList();
+ printRoomList();
+ printHelp();
+ rl.prompt();
+ break;
+ }
});
matrixClient.on("Room", function() {
@@ -44,7 +44,15 @@ window.onload = function() {
disableButtons(true, true, true);
};
-client.on("syncComplete", function () {
+matrixClient.on("sync", function(state, prevState, data) {
+ switch (state) {
+ case "PREPARED":
+ syncComplete();
+ break;
+ }
+});
+
+function syncComplete() {
document.getElementById("result").innerHTML = "<p>Ready for calls.</p>";
disableButtons(false, true, true);
@@ -85,5 +93,5 @@ client.on("syncComplete", function () {
call = c;
addListeners(call);
});
-});
+}
client.startClient();

0 comments on commit a5f0ec7

Please sign in to comment.