mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2026-04-12 02:36:05 +00:00
re-added host saving. Looks like it was lost in nacl-pairing
This commit is contained in:
@@ -73,9 +73,20 @@ function pairPushed() {
|
||||
pairingDialog.close();
|
||||
});
|
||||
sendMessage('pair', [target, randomNumber]).then(function (ret2) {
|
||||
if (ret2 === 0) {
|
||||
if (ret2 === 0) { // pairing was successful. save this host.
|
||||
$('#pairButton')[0].innerHTML = 'Paired';
|
||||
pairingDialog.close();
|
||||
var hostSelect = $('#selectHost')[0];
|
||||
for(var i = 0; i < hostSelect.length; i++) {
|
||||
if (hostSelect.options[i].value == target) return;
|
||||
}
|
||||
|
||||
var opt = document.createElement('option');
|
||||
opt.appendChild(document.createTextNode(target));
|
||||
opt.value = target;
|
||||
$('#selectHost')[0].appendChild(opt);
|
||||
hosts.push(target);
|
||||
saveHosts();
|
||||
} else {
|
||||
$('#pairButton')[0].innerHTML = 'Pairing Failed';
|
||||
document.getElementById('pairingDialogText').innerHTML = 'Error: Pairing failed with code: ' + ret2;
|
||||
|
||||
Reference in New Issue
Block a user