From f11c21c2be82324dfd2cb2ad524b96eb0dfb024b Mon Sep 17 00:00:00 2001 From: Index Date: Fri, 28 Jun 2024 18:56:50 -0500 Subject: [PATCH] minor: fix "hasn't participated in the great divide" text --- js/background.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/background.js b/js/background.js index 13fd858..b6c1f7a 100755 --- a/js/background.js +++ b/js/background.js @@ -112,7 +112,8 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { if (Statistics !== undefined && (new Date().getTime() - Statistics.requested < 300000)) { Statistics = Statistics.data } else { - Statistics = (await (await fetch('https://stats.silly.mom/player_stats?id=' + request.userID)).json()).results[0] + Statistics = (await (await fetch('https://stats.silly.mom/player_stats?id=' + request.userID)).json()).results + if (Statistics !== null) { Statistics = Statistics[0] } chrome.storage.local.set({['PolyPlus_GreatDivideStats_' + request.userID]: {data: Statistics, requested: new Date().getTime()}}, function(){}) } @@ -209,7 +210,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { }); document.body.appendChild(Script); } else { - document.getElementById('p+greatdivide_stats').innerHTML = "
This user hasn't participated in The Great Divide.
" + document.getElementById('p+greatdivide_card').innerText = "This user hasn't participated in The Great Divide." } } return true