mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
Ensure revived hosts have a valid unique ID
This commit is contained in:
parent
b186c42bf0
commit
35720d0e8e
@ -222,6 +222,19 @@ function moduleDidLoad() {
|
|||||||
console.error('%c[index.js, moduleDidLoad]', 'color: green;', 'Failed httpInit! Returned error was: ', failedInit);
|
console.error('%c[index.js, moduleDidLoad]', 'color: green;', 'Failed httpInit! Returned error was: ', failedInit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// load previously connected hosts, which have been killed into an object, and revive them back into a class
|
||||||
|
chrome.storage.sync.get('hosts', function(previousValue) {
|
||||||
|
hosts = previousValue.hosts != null ? previousValue.hosts : {};
|
||||||
|
for(var hostUID in hosts) { // programmatically add each new host.
|
||||||
|
var revivedHost = new NvHTTP(hosts[hostUID].address, myUniqueid, hosts[hostUID].userEnteredAddress);
|
||||||
|
revivedHost.serverUid = hosts[hostUID].serverUid;
|
||||||
|
revivedHost.externalIP = hosts[hostUID].externalIP;
|
||||||
|
revivedHost.hostname = hosts[hostUID].hostname;
|
||||||
|
addHostToGrid(revivedHost);
|
||||||
|
}
|
||||||
|
console.log('%c[index.js]', 'color: green;', 'Loaded previously connected hosts');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -879,19 +892,6 @@ function onWindowLoad(){
|
|||||||
$('#bitrateSlider')[0].MaterialSlider.change(previousValue.bitrate != null ? previousValue.bitrate : '10');
|
$('#bitrateSlider')[0].MaterialSlider.change(previousValue.bitrate != null ? previousValue.bitrate : '10');
|
||||||
updateBitrateField();
|
updateBitrateField();
|
||||||
});
|
});
|
||||||
|
|
||||||
// load previously connected hosts, which have been killed into an object, and revive them back into a class
|
|
||||||
chrome.storage.sync.get('hosts', function(previousValue) {
|
|
||||||
hosts = previousValue.hosts != null ? previousValue.hosts : {};
|
|
||||||
for(var hostUID in hosts) { // programmatically add each new host.
|
|
||||||
var revivedHost = new NvHTTP(hosts[hostUID].address, myUniqueid, hosts[hostUID].userEnteredAddress);
|
|
||||||
revivedHost.serverUid = hosts[hostUID].serverUid;
|
|
||||||
revivedHost.externalIP = hosts[hostUID].externalIP;
|
|
||||||
revivedHost.hostname = hosts[hostUID].hostname;
|
|
||||||
addHostToGrid(revivedHost);
|
|
||||||
}
|
|
||||||
console.log('%c[index.js]', 'color: green;', 'Loaded previously connected hosts');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user