Added graphic when gamelist empty

This commit is contained in:
Jorys_Paulin authored and Jorys Paulin committed 2018-05-05 21:51:50 +02:00
1 parent 3234ffd4ea
commit 7815f3fa5f
2 files changed
+8 -5

No files matched your search

+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) {