From 199aa726ee9bb6d4a4103de93bd08977b3c62744 Mon Sep 17 00:00:00 2001 From: John Li Date: Thu, 18 Jul 2019 09:47:33 -0700 Subject: [PATCH] Fixed double declaration. Added server down message --- backend/SQLQuery.js | 2 +- frontend/frontend.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/SQLQuery.js b/backend/SQLQuery.js index 1307f0d..f657638 100644 --- a/backend/SQLQuery.js +++ b/backend/SQLQuery.js @@ -610,7 +610,7 @@ function updateGraphTable(channelId, times){ `${today.getMonth() + 1}/${today.getDate()}/` + `${today.getFullYear()}`); - let channelId = sql.raw(channelId + _GRAPH_SUFFIX); + channelId = sql.raw(channelId + _GRAPH_SUFFIX); pool.getConnection(function(err, connection){ diff --git a/frontend/frontend.js b/frontend/frontend.js index 6b41ea3..2537b9d 100644 --- a/frontend/frontend.js +++ b/frontend/frontend.js @@ -675,6 +675,13 @@ function _createRequest(path, callback, additionalArgs={}){ url: SERVER_DOMAIN + path, type: "GET", headers: reqHeaders, + error: function(jqXHR){ + if(jqXHR["status"] == 0){ + $("#leaderboard").html("

Server is possibly down.
" + + "Please report " + + "this to 166john@gmail.com
Thank you!

"); + } + } }; // If callback exists, attach it.