diff --git a/examples/browser/lib/matrix.js b/examples/browser/lib/matrix.js index e4b1b6ecb..518d47ddb 120000 --- a/examples/browser/lib/matrix.js +++ b/examples/browser/lib/matrix.js @@ -1 +1 @@ -../../../dist/browser-matrix-dev.js \ No newline at end of file +../../../dist/browser-matrix.js \ No newline at end of file diff --git a/examples/node/app.js b/examples/node/app.js index 65bed3ba2..dcff22aac 100644 --- a/examples/node/app.js +++ b/examples/node/app.js @@ -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() { diff --git a/examples/voip/browserTest.js b/examples/voip/browserTest.js index 53b19920c..29ede49a8 100644 --- a/examples/voip/browserTest.js +++ b/examples/voip/browserTest.js @@ -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 = "
Ready for calls.
"; disableButtons(false, true, true); @@ -85,5 +93,5 @@ client.on("syncComplete", function () { call = c; addListeners(call); }); -}); +} client.startClient(); diff --git a/examples/voip/lib/matrix.js b/examples/voip/lib/matrix.js index e4b1b6ecb..518d47ddb 120000 --- a/examples/voip/lib/matrix.js +++ b/examples/voip/lib/matrix.js @@ -1 +1 @@ -../../../dist/browser-matrix-dev.js \ No newline at end of file +../../../dist/browser-matrix.js \ No newline at end of file