Don't cache results from a failed applist query

This commit is contained in:
Cameron Gutman 2016-09-24 14:10:10 -07:00
parent 479a8949a8
commit a5adc7eff1

View File

@ -263,6 +263,13 @@ NvHTTP.prototype = {
getAppListWithCacheFlush: function () { getAppListWithCacheFlush: function () {
return sendMessage('openUrl', [this._baseUrlHttps + '/applist?' + this._buildUidStr(), false]).then(function (ret) { return sendMessage('openUrl', [this._baseUrlHttps + '/applist?' + this._buildUidStr(), false]).then(function (ret) {
$xml = this._parseXML(ret); $xml = this._parseXML(ret);
$root = $xml.find("root");
if ($root.attr("status_code") != 200) {
// TODO: Bubble up an error here
console.log('applist request failed: ' + $root.attr("status_code"));
return [];
}
var rootElement = $xml.find("root")[0]; var rootElement = $xml.find("root")[0];
var appElements = rootElement.getElementsByTagName("App"); var appElements = rootElement.getElementsByTagName("App");