From 7815f3fa5f8041385406af9dcc8492837b3dc143 Mon Sep 17 00:00:00 2001 From: Jorys_Paulin Date: Sat, 5 May 2018 17:05:19 +0200 Subject: [PATCH] Added graphic when gamelist empty --- static/js/index.js | 12 +++++++----- static/res/applist_empty.svg | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 static/res/applist_empty.svg diff --git a/static/js/index.js b/static/js/index.js index 078f128..b1019cf 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -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) { diff --git a/static/res/applist_empty.svg b/static/res/applist_empty.svg new file mode 100644 index 0000000..e6aa737 --- /dev/null +++ b/static/res/applist_empty.svg @@ -0,0 +1 @@ + \ No newline at end of file