Fix some app list refreshing bugs

This commit is contained in:
Cameron Gutman 2016-07-10 21:31:35 -07:00
parent fd3d19ca03
commit 3767990bb0
3 changed files with 4 additions and 19 deletions

View File

@ -222,14 +222,10 @@ function showApps() {
return;
}
api.getAppList().then(function (appList) {
// if game grid is populated, empty it
if($("#game-grid").children().length > 0) {
$("#game-grid").empty();
}
api.getAppList().then(function (appList) {
appList.forEach(function (app) {
api.getBoxArt(app.id).then(function (resolvedPromise) {
var imageBlob = new Blob([resolvedPromise], {type: "image/png"});

View File

@ -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') {

View File

@ -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;
});
},