Skip to content

Commit

Permalink
Improve handling of attempting to quit another client's session
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Sep 25, 2016
1 parent 798ba56 commit bd881aa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions static/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,11 @@ NvHTTP.prototype = {
},

quitApp: function () {
return sendMessage('openUrl', [this._baseUrlHttps + '/cancel?' + this._buildUidStr(), false]).then(function () {
this.currentGame = 0;
}.bind(this));
return sendMessage('openUrl', [this._baseUrlHttps + '/cancel?' + this._buildUidStr(), false])
// Refresh server info after quitting because it may silently fail if the
// session belongs to a different client.
// TODO: We should probably bubble this up to our caller.
.then(refreshServerInfo().bind(this));
},

pair: function(randomNumber) {
Expand Down

0 comments on commit bd881aa

Please sign in to comment.