From b5d1cbbfdf301de733c2ee9463fb95259aa7859a Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Mon, 2 Dec 2013 04:53:43 +0000 Subject: [PATCH] use 1ms setTimeout calls to send initial requests for game score and artifact details as part of the munge code cleanups, a safety check was added to the munge searches. if no munge sets can be found, an exception is thrown and no requests are sent. if these requests are posted as part of the regular IITC boot process, these exceptions cause IITC to fail to load. this is a quick and safe fix --- code/artifact.js | 3 ++- code/game_status.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/artifact.js b/code/artifact.js index 88676ab5..cd8b118d 100644 --- a/code/artifact.js +++ b/code/artifact.js @@ -20,7 +20,8 @@ window.artifact.setup = function() { addResumeFunction(artifact.idleResume); - artifact.requestData(); + // move the initial data request onto a very short timer. prevents thrown exceptions causing IITC boot failures + setTimeout (artifact.requestData, 1); artifact._layer = new L.LayerGroup(); addLayerGroup ('Artifacts (Jarvis shards)', artifact._layer, true); diff --git a/code/game_status.js b/code/game_status.js index 10fe8d2c..94d24a6f 100644 --- a/code/game_status.js +++ b/code/game_status.js @@ -6,7 +6,8 @@ window.updateGameScoreFailCount = 0; window.updateGameScore = function(data) { if(!data) { - window.postAjax('getGameScore', {}, window.updateGameScore); + // move the postAjax call onto a very short timer. this way, if it throws an exception, it won't prevent IITC booting + setTimeout (function() { window.postAjax('getGameScore', {}, window.updateGameScore); }, 1); return; }