adding timeout

This commit is contained in:
Jacob Levine 2019-02-09 11:43:47 -06:00
parent 447e3e12a3
commit 3da5a0cbd7

View File

@ -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 */ /* 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() { function openNav() {
document.getElementById("mySidenav").style.width = "250px"; document.getElementById("mySidenav").style.width = "250px";
@ -13,7 +12,7 @@ function closeNav() {
document.body.style.backgroundColor = "white"; document.body.style.backgroundColor = "white";
} }
window.onload=function(){ window.onload = function() {
document.getElementById('sideload').style.display = 'block'; document.getElementById('sideload').style.display = 'block';
var config = { var config = {
apiKey: "(insert the TitanScout Api Key Here)", apiKey: "(insert the TitanScout Api Key Here)",
@ -24,19 +23,20 @@ window.onload=function(){
messagingSenderId: "1097635313476" messagingSenderId: "1097635313476"
}; };
firebase.initializeApp(config); firebase.initializeApp(config);
user= firebase.auth().currentUser user = firebase.auth().currentUser
if (user != null) { setTimeout(function() {
if (user.displayName != null) { if (user != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName; if (user.displayName != null) {
} else if (user.email != null) { document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName;
document.getElementById('status').innerHTML = "You are signed in as: " + user.email; } else if (user.email != null) {
} else if (user.phoneNumber != null) { document.getElementById('status').innerHTML = "You are signed in as: " + user.email;
document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber; } else if (user.phoneNumber != null) {
} else { document.getElementById('status').innerHTML = "You are signed in as: " + user.phoneNumber;
document.getElementById('status').innerHTML = "You are signed in."; } else {
} document.getElementById('status').innerHTML = "You are signed in.";
}else{ }
window.location.replace('../'); } else {
window.location.replace('../');
}, 10)
} }
} }