Add a friendly pairing error for being in game

This commit is contained in:
Cameron Gutman 2019-09-14 15:05:21 -07:00
parent 80d65e7b50
commit 3c3f207963

View File

@ -269,6 +269,12 @@ function pairTo(nvhttpHost, onSuccess, onFailure) {
return; return;
} }
if (nvhttpHost.currentGame != 0) {
snackbarLog(nvhttpHost.hostname + ' is currently in game. Quit the running app or restart the computer, then try again.');
onFailure();
return;
}
var randomNumber = String("0000" + (Math.random() * 10000 | 0)).slice(-4); var randomNumber = String("0000" + (Math.random() * 10000 | 0)).slice(-4);
var pairingDialog = document.querySelector('#pairingDialog'); var pairingDialog = document.querySelector('#pairingDialog');
$('#pairingDialogText').html('Please enter the number ' + randomNumber + ' on the GFE dialog on the computer. This dialog will be dismissed once complete'); $('#pairingDialogText').html('Please enter the number ' + randomNumber + ' on the GFE dialog on the computer. This dialog will be dismissed once complete');