Index: remoting/webapp/crd/js/me2me_activity.js |
diff --git a/remoting/webapp/crd/js/me2me_activity.js b/remoting/webapp/crd/js/me2me_activity.js |
index 0618464e9e44fbbfde4424d1a7ad034331d8943f..fe9ac40f2586d282737a0b5003e95ee7313da5a7 100644 |
--- a/remoting/webapp/crd/js/me2me_activity.js |
+++ b/remoting/webapp/crd/js/me2me_activity.js |
@@ -140,15 +140,18 @@ remoting.Me2MeActivity.prototype.onConnectionFailed = function(error) { |
that.connect_(false); |
return; |
} |
- that.onError(error); |
+ that.showErrorMessage_(error); |
}; |
this.retryOnHostOffline_ = false; |
// The plugin will be re-created when the host finished refreshing |
remoting.hostList.refresh(onHostListRefresh); |
- } else { |
- this.onError(error); |
+ } else if (!error.isNone()) { |
+ this.showErrorMessage_(error); |
} |
+ |
+ base.dispose(this.desktopActivity_); |
+ this.desktopActivity_ = null; |
}; |
/** |
@@ -172,14 +175,23 @@ remoting.Me2MeActivity.prototype.onConnected = function(connectionInfo) { |
connectionInfo.session()); |
}; |
-remoting.Me2MeActivity.prototype.onDisconnected = function() { |
- this.showFinishDialog_(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME); |
+remoting.Me2MeActivity.prototype.onDisconnected = function(error) { |
+ if (error.isNone()) { |
+ this.showFinishDialog_(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME); |
+ } else { |
+ this.reconnector_.onConnectionDropped(error); |
+ this.showErrorMessage_(error); |
+ } |
+ |
+ base.dispose(this.desktopActivity_); |
+ this.desktopActivity_ = null; |
}; |
/** |
* @param {!remoting.Error} error |
+ * @private |
*/ |
-remoting.Me2MeActivity.prototype.onError = function(error) { |
+remoting.Me2MeActivity.prototype.showErrorMessage_ = function(error) { |
var errorDiv = document.getElementById('connect-error-message'); |
l10n.localizeElementFromTag(errorDiv, error.getTag()); |
this.showFinishDialog_(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); |