Index: remoting/webapp/me2mom/client_screen.js |
diff --git a/remoting/webapp/me2mom/client_screen.js b/remoting/webapp/me2mom/client_screen.js |
index 3342d95f9674f277a6a0999197bbe56e0203e65e..ed39bb3a249b94a4b9f7e5bddcfc46ec0a6aec48 100644 |
--- a/remoting/webapp/me2mom/client_screen.js |
+++ b/remoting/webapp/me2mom/client_screen.js |
@@ -392,15 +392,12 @@ function recenterToolbar_() { |
* @return {void} Nothing. |
*/ |
remoting.connectHost = function(hostId) { |
- for (var i = 0; i < remoting.hostList.hosts.length; ++i) { |
- /** @type {remoting.Host} */ |
- var host = remoting.hostList.hosts[i]; |
- if (host.hostId != hostId) |
- continue; |
- |
- remoting.hostJid = host.jabberId; |
- remoting.hostPublicKey = host.publicKey; |
- document.getElementById('connected-to').innerText = host.hostName; |
+ var hostTableEntry = remoting.hostList.getHostForId(hostId); |
+ if (hostTableEntry) { |
simonmorris
2011/11/17 23:59:48
"if (!hostTableEntry) { return; }" is simpler.
Jamie
2011/11/18 22:54:57
Done.
|
+ remoting.hostJid = hostTableEntry.host.jabberId; |
+ remoting.hostPublicKey = hostTableEntry.host.publicKey; |
+ document.getElementById('connected-to').innerText = |
+ hostTableEntry.host.hostName; |
remoting.debug.log('Connecting to host...'); |
@@ -415,7 +412,6 @@ remoting.connectHost = function(hostId) { |
remoting.oauth2.getAccessToken(), |
callWithToken, |
remoting.connectHostWithWcs); |
- break; |
} |
} |