rephrased check script. are you happy now, JS?

This commit is contained in:
Jacob Levine 2019-02-09 12:31:25 -06:00
parent 19a9995875
commit 390f3d9c4d

View File

@ -13,18 +13,21 @@ function closeNav() {
} }
window.onload = function() { window.onload = function() {
document.getElementById('sideload').style.display = 'block'; var promise1 = new Promise(function(resolve, reject) {
var config = { document.getElementById('sideload').style.display = 'block';
apiKey: "(insert the TitanScout Api Key Here)", var config = {
authDomain: "titanscoutandroid.firebaseapp.com", apiKey: "(insert the TitanScout Api Key Here)",
databaseURL: "https://titanscoutandroid.firebaseio.com", authDomain: "titanscoutandroid.firebaseapp.com",
projectId: "titanscoutandroid", databaseURL: "https://titanscoutandroid.firebaseio.com",
storageBucket: "titanscoutandroid.appspot.com", projectId: "titanscoutandroid",
messagingSenderId: "1097635313476" storageBucket: "titanscoutandroid.appspot.com",
}; messagingSenderId: "1097635313476"
firebase.initializeApp(config); };
user = firebase.auth().currentUser firebase.initializeApp(config);
setTimeout(function() { user = firebase.auth().currentUser
resolve(user)
});
promise1.then(function(user) {
if (user != null) { if (user != null) {
if (user.displayName != null) { if (user.displayName != null) {
document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName; document.getElementById('status').innerHTML = "You are signed in as: " + user.displayName;
@ -38,5 +41,5 @@ window.onload = function() {
} else { } else {
window.location.replace('../'); window.location.replace('../');
} }
}, 10) });
} }