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.
|
// in theory we should be able to cache the api.currentGame to prevent another call.
|
||||||
function gameSelectUpdated() {
|
function gameSelectUpdated() {
|
||||||
var currentApp = $("#selectGame").val();
|
var currentApp = $("#selectGame").val();
|
||||||
api.refreshServerInfo().then(function (ret) {
|
if(api.currentGame == parseInt(currentApp)) {
|
||||||
if(api.currentGame == parseInt(currentApp)) {
|
$("#startGameButton")[0].innerHTML = 'Resume Game'
|
||||||
$("#startGameButton")[0].innerHTML = 'Resume Game'
|
} else {
|
||||||
} else {
|
$("#startGameButton")[0].innerHTML = 'Run Game'
|
||||||
$("#startGameButton")[0].innerHTML = 'Run Game'
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function startSelectedGame() {
|
function startSelectedGame() {
|
||||||
@ -286,8 +284,10 @@ function stopGame(callbackFunction) {
|
|||||||
var appName = runningApp.title;
|
var appName = runningApp.title;
|
||||||
snackbarLog('Stopping ' + appName);
|
snackbarLog('Stopping ' + appName);
|
||||||
api.quitApp().then(function (ret2) {
|
api.quitApp().then(function (ret2) {
|
||||||
showAppsMode();
|
api.refreshServerInfo().then(function (ret3) { // refresh to show no app is currently running.
|
||||||
if (typeof(callbackFunction) === "function") callbackFunction();
|
showAppsMode();
|
||||||
|
if (typeof(callbackFunction) === "function") callbackFunction();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,9 @@ function handleMessage(msg) {
|
|||||||
} else { // else, it's just info, or an event
|
} else { // else, it's just info, or an event
|
||||||
console.log(msg.data);
|
console.log(msg.data);
|
||||||
if(msg.data === 'streamTerminated') { // if it's a recognized event, notify the appropriate function
|
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