Improve handling of attempting to quit another client's session

This commit is contained in:
Cameron Gutman 2016-09-24 21:36:38 -07:00
parent 798ba56a15
commit bd881aaee4

View File

@ -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) {