now with a random pairing number, instead of 1233

This commit is contained in:
R. Aidan Campbell 2016-03-11 09:30:32 -05:00
parent 94cfe26a10
commit 255ab97677

View File

@ -64,14 +64,15 @@ function pairPushed() {
console.log("Attempting to pair to: " + target);
sendMessage('httpInit', [pairingCert.cert, pairingCert.privateKey, myUniqueid]).then(function (ret) {
console.log('httpInit function completed. it returned: ' + ret);
var randomNumber = String("0000" + (Math.random()*10000|0)).slice(-4);
var pairingDialog = document.querySelector('#pairingDialog');
document.getElementById('pairingDialogText').innerHTML =
'Please enter the number 1233 on the GFE dialog on the computer. This dialog will be dismissed once complete';
'Please enter the number ' + randomNumber + ' on the GFE dialog on the computer. This dialog will be dismissed once complete';
pairingDialog.showModal();
pairingDialog.querySelector('#CancelPairingDialog').addEventListener('click', function() {
pairingDialog.close();
});
sendMessage('pair', [target, "1233"]).then(function (ret2) {
sendMessage('pair', [target, randomNumber]).then(function (ret2) {
if (ret2 === 0) {
$('#pairButton')[0].innerHTML = 'Paired';
pairingDialog.close();