Index: remoting/webapp/host_list.js |
diff --git a/remoting/webapp/host_list.js b/remoting/webapp/host_list.js |
index c3d2d23d14cd3dfd3bc1e54da3f2f7acfa00016f..a03f4b03a4c88ef31caf8e6b4e303851ebecc3e5 100644 |
--- a/remoting/webapp/host_list.js |
+++ b/remoting/webapp/host_list.js |
@@ -116,11 +116,10 @@ remoting.HostList.prototype.refresh = function(onDone) { |
}; |
/** @param {remoting.Error} error */ |
var onError = function(error) { |
+ that.hosts_ = []; |
that.lastError_ = error; |
onDone(false); |
}; |
- this.hosts_ = []; |
- this.lastError_ = ''; |
Wez
2012/07/11 20:48:10
Are you relying on the fact that lastError_ will o
Jamie
2012/07/11 20:53:11
No, I think your next comment is correct, and I sh
|
remoting.oauth2.callWithToken(getHosts, onError); |
}; |
@@ -135,6 +134,7 @@ remoting.HostList.prototype.refresh = function(onDone) { |
* @private |
*/ |
remoting.HostList.prototype.parseHostListResponse_ = function(onDone, xhr) { |
+ this.hosts_ = []; |
Wez
2012/07/11 20:48:10
I think you need to clear lastError_ here to avoid
Jamie
2012/07/11 20:53:11
Done.
|
try { |
if (xhr.status == 200) { |
var response = |
@@ -155,10 +155,9 @@ remoting.HostList.prototype.parseHostListResponse_ = function(onDone, xhr) { |
return 0; |
}; |
this.hosts_ = /** @type {Array} */ this.hosts_.sort(cmp); |
- } else { |
- this.hosts_ = []; |
} |
} else { |
+ this.lastError_ = remoting.Error.UNEXPECTED; |
console.error('Invalid "hosts" response from server.'); |
} |
} else { |