mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
Fix some app list refreshing bugs
This commit is contained in:
parent
fd3d19ca03
commit
3767990bb0
@ -222,14 +222,10 @@ function showApps() {
|
||||
return;
|
||||
}
|
||||
|
||||
// if game grid is populated, empty it
|
||||
$("#game-grid").empty();
|
||||
|
||||
api.getAppList().then(function (appList) {
|
||||
|
||||
// if game grid is populated, empty it
|
||||
if($("#game-grid").children().length > 0) {
|
||||
$("#game-grid").empty();
|
||||
}
|
||||
|
||||
|
||||
appList.forEach(function (app) {
|
||||
api.getBoxArt(app.id).then(function (resolvedPromise) {
|
||||
var imageBlob = new Blob([resolvedPromise], {type: "image/png"});
|
||||
|
@ -23,7 +23,7 @@ function handleMessage(msg) {
|
||||
if(msg.data === 'streamTerminated') { // if it's a recognized event, notify the appropriate function
|
||||
$('#loadingSpinner').css('display', 'none'); // This is a fallback for RTSP handshake failing, which immediately terminates the stream.
|
||||
api.refreshServerInfo().then(function (ret) {
|
||||
showAppsMode();
|
||||
showApps();
|
||||
chrome.app.window.current().restore();
|
||||
});
|
||||
} else if(msg.data === 'Connection Established') {
|
||||
|
@ -40,7 +40,6 @@ function NvHTTP(address, clientUid) {
|
||||
this.clientUid = clientUid;
|
||||
this._baseUrlHttps = 'https://' + address + ':47984';
|
||||
this._baseUrlHttp = 'http://' + address + ':47989';
|
||||
this._appListCache = null;
|
||||
this._memCachedBoxArtArray = {};
|
||||
_self = this;
|
||||
};
|
||||
@ -133,13 +132,6 @@ NvHTTP.prototype = {
|
||||
},
|
||||
|
||||
getAppList: function () {
|
||||
if (_self._appListCache) {
|
||||
console.log('Returning app list from cache');
|
||||
return new Promise(function (resolve, reject) {
|
||||
resolve(_self._appListCache);
|
||||
});
|
||||
}
|
||||
|
||||
return sendMessage('openUrl', [_self._baseUrlHttps + '/applist?' + _self._buildUidStr(), false]).then(function (ret) {
|
||||
$xml = _self._parseXML(ret);
|
||||
|
||||
@ -155,9 +147,6 @@ NvHTTP.prototype = {
|
||||
});
|
||||
}
|
||||
|
||||
if (appList)
|
||||
_self._appListCache = appList;
|
||||
|
||||
return appList;
|
||||
});
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user