mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
Remove unpair functionality because it doesn't work on modern GFE versions
This commit is contained in:
parent
6e9de371d7
commit
da960c0be1
12
index.html
12
index.html
@ -104,16 +104,16 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<dialog id="unpairHostDialog" class="mdl-dialog">
|
||||
<h3 class="mdl-dialog__title">Unpair from this host?</h3>
|
||||
<dialog id="deleteHostDialog" class="mdl-dialog">
|
||||
<h3 class="mdl-dialog__title">Delete PC</h3>
|
||||
<div class="mdl-dialog__content">
|
||||
<p id="unpairHostDialogText">
|
||||
Are you sure you want to unpair from this host?
|
||||
<p id="deleteHostDialogText">
|
||||
Are you sure you want to delete this host?
|
||||
</p>
|
||||
</div>
|
||||
<div class="mdl-dialog__actions">
|
||||
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="cancelUnpairHost">No</button>
|
||||
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="continueUnpairHost">Yes</button>
|
||||
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="cancelDeleteHost">No</button>
|
||||
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="continueDeleteHost">Yes</button>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
|
@ -297,7 +297,7 @@ function addHostToGrid(host, ismDNSDiscovered=false) {
|
||||
var removalButton = $("<div>", {class: "remove-host", id: "removeHostButton-" + host.serverUid});
|
||||
removalButton.off('click');
|
||||
removalButton.click(function () {
|
||||
unpairClicked(host);
|
||||
removeClicked(host);
|
||||
});
|
||||
cell.off('click');
|
||||
cell.click(function () {
|
||||
@ -305,41 +305,35 @@ function addHostToGrid(host, ismDNSDiscovered=false) {
|
||||
});
|
||||
$(outerDiv).append(cell);
|
||||
if (!ismDNSDiscovered) {
|
||||
// we don't have the option to unpair from mDNS hosts. So don't show it to the user.
|
||||
// we don't have the option to delete mDNS hosts. So don't show it to the user.
|
||||
$(outerDiv).append(removalButton);
|
||||
}
|
||||
$('#host-grid').append(outerDiv);
|
||||
hosts[host.serverUid] = host;
|
||||
}
|
||||
|
||||
function unpairClicked(host) {
|
||||
var unpairHostDialog = document.querySelector('#unpairHostDialog');
|
||||
document.getElementById('unpairHostDialogText').innerHTML =
|
||||
' Are you sure you want like to unpair from ' + host.hostname + '?';
|
||||
unpairHostDialog.showModal();
|
||||
function removeClicked(host) {
|
||||
var deleteHostDialog = document.querySelector('#deleteHostDialog');
|
||||
document.getElementById('deleteHostDialogText').innerHTML =
|
||||
' Are you sure you want like to delete ' + host.hostname + '?';
|
||||
deleteHostDialog.showModal();
|
||||
|
||||
$('#cancelUnpairHost').off('click');
|
||||
$('#cancelUnpairHost').on('click', function () {
|
||||
unpairHostDialog.close();
|
||||
$('#cancelDeleteHost').off('click');
|
||||
$('#cancelDeleteHost').on('click', function () {
|
||||
deleteHostDialog.close();
|
||||
});
|
||||
|
||||
// locally remove the hostname/ip from the saved `hosts` array.
|
||||
// note: this does not make the host forget the pairing to us.
|
||||
// this means we can re-add the host, and will still be paired.
|
||||
$('#continueUnpairHost').off('click');
|
||||
$('#continueUnpairHost').on('click', function () {
|
||||
host.unpair().then(function (onSuccess) {
|
||||
var unpairHostDialog = document.querySelector('#unpairHostDialog');
|
||||
$('#host-container-' + host.serverUid).remove();
|
||||
snackbarLog('Successfully unpaired from host');
|
||||
delete hosts[host.serverUid]; // remove the host from the array;
|
||||
saveHosts();
|
||||
}, function (onFailure) {
|
||||
snackbarLog('Failed to unpair from host!');
|
||||
});
|
||||
unpairHostDialog.close();
|
||||
$('#continueDeleteHost').off('click');
|
||||
$('#continueDeleteHost').on('click', function () {
|
||||
var deleteHostDialog = document.querySelector('#deleteHostDialog');
|
||||
$('#host-container-' + host.serverUid).remove();
|
||||
delete hosts[host.serverUid]; // remove the host from the array;
|
||||
saveHosts();
|
||||
deleteHostDialog.close();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// puts the CSS style for current app on the app that's currently running
|
||||
|
@ -465,10 +465,6 @@ NvHTTP.prototype = {
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
unpair: function () {
|
||||
return sendMessage('openUrl', [this._baseUrlHttps + '/unpair?' + this._buildUidStr(), false]);
|
||||
},
|
||||
|
||||
_buildUidStr: function () {
|
||||
return 'uniqueid=' + this.clientUid + '&uuid=' + guuid();
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user