From 6153cc30b4ce8da34ad4ca8c363a8f266d27a979 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Thu, 4 Jan 2018 22:50:14 -0500 Subject: [PATCH] Replace load_location_hash with a callback --- CTFd/themes/core/static/js/chalboard.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CTFd/themes/core/static/js/chalboard.js b/CTFd/themes/core/static/js/chalboard.js index b21e5a56..56563a59 100644 --- a/CTFd/themes/core/static/js/chalboard.js +++ b/CTFd/themes/core/static/js/chalboard.js @@ -342,16 +342,18 @@ var load_location_hash = function () { } }; -function update(){ +function update(cb){ load_user_solves(function () { // Load the user's solved challenge ids loadchals(function () { // Load the full list of challenges - updatesolves(load_location_hash); // Load the counts of all challenge solves and then load the location hash specified challenge + updatesolves(cb); // Load the counts of all challenge solves and then load the location hash specified challenge }); }); } $(function() { - update(); + update(function(){ + load_location_hash(); + }); }); $('.nav-tabs a').click(function (e) {