From 845f75f8a7dc054628aefd70be422d19421f7d51 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Thu, 14 Sep 2017 10:48:59 +0200 Subject: [PATCH] remove a 100ms dead spot from page load --- www/common/sframe-boot.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/www/common/sframe-boot.js b/www/common/sframe-boot.js index f2fcadc37..8510e88a0 100644 --- a/www/common/sframe-boot.js +++ b/www/common/sframe-boot.js @@ -47,12 +47,15 @@ var afterLoaded = function (req) { window.addEventListener('message', onReply); }; -var intr = setInterval(function () { +var load0 = function () { try { var req = JSON.parse(decodeURIComponent(window.location.hash.substring(1))); - clearInterval(intr); afterLoaded(req); - } catch (e) { console.error(e); } -}, 100); + } catch (e) { + console.error(e); + setTimeout(load0, 100); + } +}; +load0(); }());