mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Return after invoking a completion handler
This commit is contained in:
parent
237fcdeef8
commit
c2fde815fa
@ -104,12 +104,14 @@ function pairTo(host, onSuccess, onFailure) {
|
|||||||
snackbarLog('ERROR: cert has not been generated yet. Is NaCl initialized?');
|
snackbarLog('ERROR: cert has not been generated yet. Is NaCl initialized?');
|
||||||
console.log("User wants to pair, and we still have no cert. Problem = very yes.");
|
console.log("User wants to pair, and we still have no cert. Problem = very yes.");
|
||||||
onFailure();
|
onFailure();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
api = new NvHTTP(host, myUniqueid);
|
api = new NvHTTP(host, myUniqueid);
|
||||||
api.refreshServerInfo().then(function (ret) {
|
api.refreshServerInfo().then(function (ret) {
|
||||||
if (api.paired) {
|
if (api.paired) {
|
||||||
onSuccess();
|
onSuccess();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var randomNumber = String("0000" + (Math.random()*10000|0)).slice(-4);
|
var randomNumber = String("0000" + (Math.random()*10000|0)).slice(-4);
|
||||||
@ -126,12 +128,12 @@ function pairTo(host, onSuccess, onFailure) {
|
|||||||
$('#pairingDialogText').html('Error: failed to pair with ' + host + '. failure reason unknown.');
|
$('#pairingDialogText').html('Error: failed to pair with ' + host + '. failure reason unknown.');
|
||||||
}
|
}
|
||||||
onFailure();
|
onFailure();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
snackbarLog('Pairing successful');
|
snackbarLog('Pairing successful');
|
||||||
pairingDialog.close();
|
pairingDialog.close();
|
||||||
onSuccess();
|
onSuccess();
|
||||||
|
|
||||||
}, function (failedPairing) {
|
}, function (failedPairing) {
|
||||||
snackbarLog('Failed pairing to: ' + host);
|
snackbarLog('Failed pairing to: ' + host);
|
||||||
console.log('pairing failed, and returned ' + failedPairing);
|
console.log('pairing failed, and returned ' + failedPairing);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user