From 0b0d36d66067a1fb2bb8574d791ade500cc01c75 Mon Sep 17 00:00:00 2001 From: Jacob Levine Date: Sat, 9 Feb 2019 13:01:14 -0600 Subject: [PATCH] last-ditch effort to make js not multithread everything --- website/public/profile/scripts.js | 8 ++++++-- website/public/stats/scripts.js | 11 +++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/website/public/profile/scripts.js b/website/public/profile/scripts.js index 1fadb7e3..dbec65a0 100644 --- a/website/public/profile/scripts.js +++ b/website/public/profile/scripts.js @@ -23,9 +23,13 @@ window.onload = function() { storageBucket: "titanscoutandroid.appspot.com", messagingSenderId: "1097635313476" }; + //eventually find a less-jank way to do this tho firebase.initializeApp(config); - user = firebase.auth().currentUser - resolve(user) + setTimeout(function(){ + user = firebase.auth().currentUser + resolve(user) + },10) + }); promise1.then(function(user) { if (user != null) { diff --git a/website/public/stats/scripts.js b/website/public/stats/scripts.js index b536edd7..dbec65a0 100644 --- a/website/public/stats/scripts.js +++ b/website/public/stats/scripts.js @@ -23,12 +23,15 @@ window.onload = function() { storageBucket: "titanscoutandroid.appspot.com", messagingSenderId: "1097635313476" }; + //eventually find a less-jank way to do this tho firebase.initializeApp(config); - user = firebase.auth().currentUser - resolve(null) + setTimeout(function(){ + user = firebase.auth().currentUser + resolve(user) + },10) + }); - promise1.then(function(a) { - user=firebase.auth().currentUser + promise1.then(function(user) { if (user != null) { if (user.displayName != null) { document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName;