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