| Index: remoting/webapp/crd/js/host_list.js
|
| diff --git a/remoting/webapp/crd/js/host_list.js b/remoting/webapp/crd/js/host_list.js
|
| index 4221115d3e33e8c1cb040800b29e43b435eddef6..307c0afce1276edf0cbdce04c40136b3ec668ebf 100644
|
| --- a/remoting/webapp/crd/js/host_list.js
|
| +++ b/remoting/webapp/crd/js/host_list.js
|
| @@ -67,10 +67,10 @@ remoting.HostList = function(table, noHosts, errorMsg, errorButton,
|
| */
|
| this.hosts_ = [];
|
| /**
|
| - * @type {string}
|
| + * @type {!remoting.Error}
|
| * @private
|
| */
|
| - this.lastError_ = '';
|
| + this.lastError_ = remoting.Error.NONE;
|
| /**
|
| * @type {remoting.Host?}
|
| * @private
|
| @@ -167,7 +167,7 @@ remoting.HostList.prototype.refresh = function(onDone) {
|
| this.loadingIndicator_.classList.add('loading');
|
| /** @type {remoting.HostList} */
|
| var that = this;
|
| - /** @param {remoting.Error} error */
|
| + /** @param {!remoting.Error} error */
|
| var onError = function(error) {
|
| that.lastError_ = error;
|
| onDone(false);
|
| @@ -187,12 +187,12 @@ remoting.HostList.prototype.refresh = function(onDone) {
|
| * @private
|
| */
|
| remoting.HostList.prototype.onHostListResponse_ = function(onDone, hosts) {
|
| - this.lastError_ = '';
|
| + this.lastError_ = remoting.Error.NONE;
|
| this.hosts_ = hosts;
|
| this.sortHosts_();
|
| this.save_();
|
| this.loadingIndicator_.classList.remove('loading');
|
| - onDone(this.lastError_ == '');
|
| + onDone(true);
|
| };
|
|
|
| /**
|
| @@ -242,8 +242,8 @@ remoting.HostList.prototype.display = function() {
|
| this.noHosts_.hidden = !noHostsRegistered;
|
|
|
| if (this.lastError_ != '') {
|
| - l10n.localizeElementFromTag(this.errorMsg_, this.lastError_);
|
| - if (this.lastError_ == remoting.Error.AUTHENTICATION_FAILED) {
|
| + l10n.localizeElementFromTag(this.errorMsg_, this.lastError_.tag);
|
| + if (this.lastError_.tag == remoting.Error.Tag.AUTHENTICATION_FAILED) {
|
| l10n.localizeElementFromTag(this.errorButton_,
|
| /*i18n-content*/'SIGN_IN_BUTTON');
|
| } else {
|
| @@ -481,7 +481,7 @@ remoting.HostList.prototype.onLocalHostStarted = function(
|
| * @private
|
| */
|
| remoting.HostList.prototype.onErrorClick_ = function() {
|
| - if (this.lastError_ == remoting.Error.AUTHENTICATION_FAILED) {
|
| + if (this.lastError_.tag == remoting.Error.Tag.AUTHENTICATION_FAILED) {
|
| remoting.handleAuthFailureAndRelaunch();
|
| } else {
|
| this.refresh(remoting.updateLocalHostState);
|
|
|