From 3234ffd4eae4d48ac37bebc9586c046c890622e6 Mon Sep 17 00:00:00 2001 From: Jorys_Paulin Date: Sat, 5 May 2018 16:52:25 +0200 Subject: [PATCH] Added graphic when gamelist error --- static/js/index.js | 8 ++++++-- static/res/applist_error.svg | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 static/res/applist_error.svg diff --git a/static/js/index.js b/static/js/index.js index fb05cad..078f128 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -484,6 +484,8 @@ function showApps(host) { $('#naclSpinnerMessage').text('Loading apps...'); $('#naclSpinner').css('display', 'inline-block'); + $("div.game-container").remove(); + host.getAppList().then(function(appList) { if(appList.length == 0) { // TODO: Add placeholder graphic console.error('%c[index.js, showApps]', 'User\'s applist is empty') @@ -491,7 +493,6 @@ function showApps(host) { return; // We stop the function right here } // if game grid is populated, empty it - $("div.game-container").remove(); $('#naclSpinner').hide(); $("#game-grid").show(); @@ -543,7 +544,10 @@ function showApps(host) { $(outerDiv).append(img); }); }, function(failedAppList) { - $('#naclSpinner').hide(); // TODO: Add placeholder graphic + $('#naclSpinner').hide(); + var img = new Image(); + img.src = 'static/res/applist_error.svg' + $("#game-grid").html(img) snackbarLog('Unable to get your games') console.error('%c[index.js, showApps]', 'Failed to get applist from host: ' + host.hostname, '\n Host object:', host, host.toString()); }); diff --git a/static/res/applist_error.svg b/static/res/applist_error.svg new file mode 100644 index 0000000..0088948 --- /dev/null +++ b/static/res/applist_error.svg @@ -0,0 +1 @@ + \ No newline at end of file