From 3c3f207963f0252461630e52b52b5ed8c91cad85 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 14 Sep 2019 15:05:21 -0700 Subject: [PATCH] Add a friendly pairing error for being in game --- static/js/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/js/index.js b/static/js/index.js index 8d6162a..9ae332b 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -269,6 +269,12 @@ function pairTo(nvhttpHost, onSuccess, onFailure) { 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 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');