mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
cleaned up some unnecessary NvHTTP calls to make things faster
This commit is contained in:
parent
8a31d90342
commit
de464802cf
@ -170,13 +170,11 @@ function showAppsMode() {
|
||||
// in theory we should be able to cache the api.currentGame to prevent another call.
|
||||
function gameSelectUpdated() {
|
||||
var currentApp = $("#selectGame").val();
|
||||
api.refreshServerInfo().then(function (ret) {
|
||||
if(api.currentGame == parseInt(currentApp)) {
|
||||
$("#startGameButton")[0].innerHTML = 'Resume Game'
|
||||
} else {
|
||||
$("#startGameButton")[0].innerHTML = 'Run Game'
|
||||
}
|
||||
});
|
||||
if(api.currentGame == parseInt(currentApp)) {
|
||||
$("#startGameButton")[0].innerHTML = 'Resume Game'
|
||||
} else {
|
||||
$("#startGameButton")[0].innerHTML = 'Run Game'
|
||||
}
|
||||
}
|
||||
|
||||
function startSelectedGame() {
|
||||
@ -286,8 +284,10 @@ function stopGame(callbackFunction) {
|
||||
var appName = runningApp.title;
|
||||
snackbarLog('Stopping ' + appName);
|
||||
api.quitApp().then(function (ret2) {
|
||||
showAppsMode();
|
||||
if (typeof(callbackFunction) === "function") callbackFunction();
|
||||
api.refreshServerInfo().then(function (ret3) { // refresh to show no app is currently running.
|
||||
showAppsMode();
|
||||
if (typeof(callbackFunction) === "function") callbackFunction();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -21,7 +21,9 @@ function handleMessage(msg) {
|
||||
} else { // else, it's just info, or an event
|
||||
console.log(msg.data);
|
||||
if(msg.data === 'streamTerminated') { // if it's a recognized event, notify the appropriate function
|
||||
showAppsMode();
|
||||
api.refreshServerInfo().then(function (ret) {
|
||||
showAppsMode();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user