From 3da5a0cbd75b7696a30c7fbca34752b22a86f7b8 Mon Sep 17 00:00:00 2001 From: Jacob Levine Date: Sat, 9 Feb 2019 11:43:47 -0600 Subject: [PATCH] adding timeout --- website/public/stats/scripts.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/website/public/stats/scripts.js b/website/public/stats/scripts.js index 15d7482b..ff3df1cb 100644 --- a/website/public/stats/scripts.js +++ b/website/public/stats/scripts.js @@ -1,4 +1,3 @@ - /* Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body */ function openNav() { document.getElementById("mySidenav").style.width = "250px"; @@ -13,7 +12,7 @@ function closeNav() { document.body.style.backgroundColor = "white"; } -window.onload=function(){ +window.onload = function() { document.getElementById('sideload').style.display = 'block'; var config = { apiKey: "(insert the TitanScout Api Key Here)", @@ -24,19 +23,20 @@ window.onload=function(){ messagingSenderId: "1097635313476" }; firebase.initializeApp(config); - user= firebase.auth().currentUser - if (user != null) { - if (user.displayName != null) { - document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName; - } else if (user.email != null) { - document.getElementById('status').innerHTML = "You are signed in as: " + user.email; - } else if (user.phoneNumber != null) { - document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber; - } else { - document.getElementById('status').innerHTML = "You are signed in."; - } - }else{ - window.location.replace('../'); + user = firebase.auth().currentUser + setTimeout(function() { + if (user != null) { + if (user.displayName != null) { + document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName; + } else if (user.email != null) { + document.getElementById('status').innerHTML = "You are signed in as: " + user.email; + } else if (user.phoneNumber != null) { + document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber; + } else { + document.getElementById('status').innerHTML = "You are signed in."; + } + } else { + window.location.replace('../'); + }, 10) } - }