Skip to content

Commit

Permalink
* we have to use getparam to get the disconnection message now that w…
Browse files Browse the repository at this point in the history
…e may use session storage

* better disconnection message handling: don't clear the message if we have one, unless we re-connect and init the state again

git-svn-id: https://xpra.org/svn/Xpra/trunk@15484 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 1, 2017
1 parent ffaff63 commit ce35b37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/html5/connect.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ <h4 class="panel-title">Advanced options</h4>
$(document).ready(function() {

var ssl = document.location.protocol=="https:";
var disconnect_reason = window.location.getParameter("disconnect") || null;
var disconnect_reason = getparam("disconnect") || null;

if(disconnect_reason) {
document.getElementById("alert-disconnect").style.display = "block";
Expand Down
13 changes: 5 additions & 8 deletions src/html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ XpraClient.prototype.open_protocol = function() {
}

XpraClient.prototype.close = function() {
console.error("client closed");
console.log("client closed");
this.close_windows();
this.clear_timers();
this.close_audio();
Expand Down Expand Up @@ -1197,8 +1197,6 @@ XpraClient.prototype._process_error = function(packet, ctx) {
if (!ctx.reconnect || ctx.reconnect_attempt>=ctx.reconnect_count) {
// call the client's close callback
ctx.callback_close(ctx.disconnect_reason);
// clear the reason
ctx.disconnect_reason = null;
}
}

Expand Down Expand Up @@ -1236,18 +1234,17 @@ XpraClient.prototype._process_close = function(packet, ctx) {
ctx.close_protocol();
// call the client's close callback
ctx.callback_close(ctx.disconnect_reason);
// clear the reason
ctx.disconnect_reason = null;
}
}

XpraClient.prototype._process_disconnect = function(packet, ctx) {
// save the disconnect reason
ctx.disconnect_reason = packet[1];
var reason = packet[1];
console.debug("disconnect reason:", reason);
ctx.disconnect_reason = reason;
ctx.close();
// call the client's close callback
ctx.callback_close(ctx.disconnect_reason);
ctx.disconnect_reason = null;
ctx.callback_close(reason);
}

XpraClient.prototype._process_startup_complete = function(packet, ctx) {
Expand Down

0 comments on commit ce35b37

Please sign in to comment.