From bd881aaee4d00173a682c9a37deee208ff857b1c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 24 Sep 2016 21:36:38 -0700 Subject: [PATCH] Improve handling of attempting to quit another client's session --- static/js/utils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/static/js/utils.js b/static/js/utils.js index 2025a4a..08a88de 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -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) {