From 1086bf6eee984e0f3e386296af5fb5f093b53f5b Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sun, 5 May 2019 19:02:57 -0600 Subject: [PATCH] Refresh player stats every 30 seconds --- www/js/home.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/www/js/home.js b/www/js/home.js index 62efeb1..4b0d123 100644 --- a/www/js/home.js +++ b/www/js/home.js @@ -18,6 +18,16 @@ function loadHomePage(callback) { initChat(); refreshChat(); setInterval(refreshChat, 1000 * 15); + // Refresh health bar + setInterval(function () { + callAPI("getprofile", { + username: localStorage.getItem("username"), + password: localStorage.getItem("password") + }, function (data) { + playerProfile = data.profile; + setupProfile(); + }); + }, 1000 * 30); callback(); }); }