Added graphic when gamelist empty

This commit is contained in:
Jorys_Paulin
2018-05-05 17:05:19 +02:00
committed by Jorys Paulin
parent 3234ffd4ea
commit 7815f3fa5f
2 changed files with 8 additions and 5 deletions
+7 -5
View File
@@ -487,16 +487,18 @@ function showApps(host) {
$("div.game-container").remove();
host.getAppList().then(function(appList) {
if(appList.length == 0) { // TODO: Add placeholder graphic
$('#naclSpinner').hide();
$("#game-grid").show();
if(appList.length == 0) {
console.error('%c[index.js, showApps]', 'User\'s applist is empty')
var img = new Image()
img.src = 'static/res/applist_empty.svg'
document.getElementById('game-grid').appendChild(img)
snackbarLog('Your game list is empty')
return; // We stop the function right here
}
// if game grid is populated, empty it
$('#naclSpinner').hide();
$("#game-grid").show();
const sortedAppList = sortTitles(appList, 'ASC');
sortedAppList.forEach(function(app) {